/* ==========================================================================
   HelpDocs Enterprise Knowledge Base - Design System & Modern UI
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Neutrals */
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-hover: #f1f5f9;
  --color-surface-card: #ffffff;
  --color-border: #e2e8f0;
  --color-border-subtle: #f1f5f9;
  
  --color-text-main: #0f172a;
  --color-text-muted: #64748b;
  --color-text-subtle: #94a3b8;

  /* Brand Accents */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;

  --accent-smartcashier: #2563eb;
  --accent-foodyme: #ea580c;

  /* Semantic Alerts */
  --tip-bg: #f0fdf4;
  --tip-border: #86efac;
  --tip-text: #166534;

  --warning-bg: #fffbeb;
  --warning-border: #fcd34d;
  --warning-text: #92400e;

  --important-bg: #eef2ff;
  --important-border: #a5b4fc;
  --important-text: #3730a3;

  --shortcut-bg: #faf5ff;
  --shortcut-border: #d8b4fe;
  --shortcut-text: #6b21a8;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-main);
  background-color: var(--color-bg);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Layout Utilities */
.kb-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.kb-container-narrow {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Sticky Header */
.kb-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--transition-normal);
}

.kb-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 1.5rem;
}

.kb-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: -0.02em;
}

.kb-brand-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  border: 1px solid var(--primary-border);
}

.kb-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.kb-nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.kb-nav-link:hover {
  color: var(--color-text-main);
}

.kb-nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

/* Quick Search Trigger in Header */
.kb-header-search-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #f1f5f9;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 220px;
}

.kb-header-search-btn:hover {
  background: #ffffff;
  border-color: var(--primary-border);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  color: var(--color-text-main);
}

.kb-kbd-pill {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text-muted);
  box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}

/* Hero Section */
.kb-hero {
  position: relative;
  padding: 4.5rem 0 3.5rem;
  background: radial-gradient(circle at 50% -20%, rgba(37, 99, 235, 0.08) 0%, rgba(248, 250, 252, 0) 70%);
  text-align: center;
  border-bottom: 1px solid var(--color-border-subtle);
}

.kb-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  background: #ffffff;
  color: var(--primary);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.kb-hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--color-text-main);
  max-width: 800px;
  margin: 0 auto 1rem;
}

.kb-hero-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 640px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

/* Search Box Component */
.kb-search-container {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

.kb-search-bar {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.5rem 0.35rem 1.25rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  transition: all var(--transition-normal);
}

.kb-search-input-group {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.kb-search-actions-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.kb-search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 12px 28px -5px rgba(37, 99, 235, 0.15);
}

.kb-search-icon {
  color: var(--color-text-subtle);
  flex-shrink: 0;
  margin-right: 0.75rem;
}

.kb-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  color: var(--color-text-main);
  background: transparent;
}

.kb-search-input::placeholder {
  color: var(--color-text-subtle);
}

.kb-search-scope-select {
  border: none;
  background: #f8fafc;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  border: 1px solid var(--color-border);
  margin-right: 0.5rem;
}

.kb-search-btn {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.kb-search-btn:hover {
  background: var(--primary-hover);
}

/* Scoped Filter Pills */
.kb-filter-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.kb-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  background: #ffffff;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.kb-pill:hover {
  background: #f1f5f9;
  color: var(--color-text-main);
  border-color: #cbd5e1;
}

.kb-pill.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
  font-weight: 600;
}

/* SaaS Product Grid */
.kb-section {
  padding: 3.5rem 0;
}

.kb-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.kb-section-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--color-text-main);
}

.kb-section-subtitle {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.kb-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.75rem;
}

.kb-product-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  overflow: hidden;
}

.kb-product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--product-brand-color, var(--primary));
  opacity: 0.9;
}

.kb-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: #cbd5e1;
}

.kb-product-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.kb-product-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--product-brand-color-light, var(--primary-light));
  color: var(--product-brand-color, var(--primary));
}

.kb-product-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--color-text-muted);
}

.kb-product-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.kb-product-tagline {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.kb-product-desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  flex: 1;
}

.kb-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border-subtle);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}

/* Article Cards Grid */
.kb-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.kb-article-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.kb-article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.kb-article-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.6rem;
}

.kb-article-card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-text-main);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.kb-article-card-excerpt {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}

.kb-article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border-subtle);
}

/* Article Page Layout */
.kb-article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 3.5rem;
  padding: 2.5rem 0 5rem;
}

.kb-article-main {
  min-width: 0;
}

/* Breadcrumbs */
.kb-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.kb-breadcrumb-separator {
  color: var(--color-text-subtle);
}

/* Article Header */
.kb-article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--color-border);
}

.kb-article-title {
  font-size: 2.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--color-text-main);
  margin-bottom: 1rem;
}

.kb-article-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.kb-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Video Player Embed Wrapper (16:9 Responsive) */
.kb-video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin: 2rem 0;
  background: #000000;
  border: 1px solid var(--color-border);
}

.kb-video-wrapper iframe,
.kb-video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Article Body Typography */
.kb-article-body {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: #334155;
}

.kb-article-body p {
  margin-bottom: 1.5rem;
}

.kb-article-body h2 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-main);
  margin: 2.5rem 0 1rem;
  padding-top: 1rem;
  scroll-margin-top: 90px;
}

.kb-article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--color-text-main);
  margin: 2rem 0 0.75rem;
  scroll-margin-top: 90px;
}

.kb-article-body ul {
  list-style-type: disc;
  margin-bottom: 1.5rem;
  padding-left: 1.75rem;
}

.kb-article-body ol {
  list-style-type: decimal;
  margin-bottom: 1.5rem;
  padding-left: 1.75rem;
}

.kb-article-body li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.kb-article-body ul ul,
.kb-article-body ol ul {
  list-style-type: circle;
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
  padding-left: 1.25rem;
}

.kb-article-body ul ol,
.kb-article-body ol ol {
  list-style-type: lower-alpha;
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
  padding-left: 1.25rem;
}

.kb-article-body hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

.kb-heading-anchor {
  position: relative;
}

.kb-anchor-link {
  position: absolute;
  left: -1.25rem;
  color: var(--color-text-subtle);
  opacity: 0;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.kb-heading-anchor:hover .kb-anchor-link {
  opacity: 1;
  color: var(--primary);
}

/* Callout & Alert Blocks */
.kb-callout {
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  border: 1px solid transparent;
  border-left-width: 4px;
}

.kb-callout-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
}

.kb-callout-icon {
  display: flex;
  align-items: center;
}

.kb-callout-body {
  font-size: 0.9375rem;
  line-height: 1.6;
}

.kb-callout-body p:last-child {
  margin-bottom: 0;
}

.kb-callout-tip {
  background: var(--tip-bg);
  border-color: var(--tip-border);
  border-left-color: #10b981;
  color: var(--tip-text);
}

.kb-callout-warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  border-left-color: #f59e0b;
  color: var(--warning-text);
}

.kb-callout-important {
  background: var(--important-bg);
  border-color: var(--important-border);
  border-left-color: #6366f1;
  color: var(--important-text);
}

.kb-callout-keyboard-shortcut {
  background: var(--shortcut-bg);
  border-color: var(--shortcut-border);
  border-left-color: #a855f7;
  color: var(--shortcut-text);
}

.kb-callout-note {
  background: #f0f9ff;
  border-color: #bae6fd;
  border-left-color: #0ea5e9;
  color: #0369a1;
}

/* Keyboard Shortcut Tags (<kbd>) */
kbd, .kb-kbd {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  display: inline-block;
  padding: 0.2rem 0.45rem;
  color: #1e293b;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-bottom: 2px solid #94a3b8;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  line-height: 1;
}

/* Lightbox-Zoomable Image Containers */
.kb-figure {
  margin: 2rem 0;
  text-align: center;
}

.kb-image-container {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  cursor: zoom-in;
  background: #0f172a;
}

.kb-zoomable-img {
  display: block;
  max-width: 100%;
  height: auto;
  transition: transform var(--transition-normal);
}

.kb-image-container:hover .kb-zoomable-img {
  transform: scale(1.01);
}

.kb-zoom-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  pointer-events: none;
  opacity: 0.85;
  transition: opacity var(--transition-fast);
}

.kb-image-container:hover .kb-zoom-btn {
  opacity: 1;
}

.kb-img-caption {
  margin-top: 0.6rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Code Blocks with Copy Button */
.kb-code-wrapper {
  margin: 1.75rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0f172a;
  border: 1px solid #1e293b;
  box-shadow: var(--shadow-md);
}

.kb-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: var(--font-mono);
}

.kb-copy-code-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid #475569;
  color: #cbd5e1;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.kb-copy-code-btn:hover {
  background: #334155;
  color: #ffffff;
}

.kb-code-wrapper pre {
  padding: 1.25rem;
  overflow-x: auto;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: #e2e8f0;
}

/* Lightbox Modal */
.kb-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.kb-lightbox-overlay.active {
  display: flex;
  opacity: 1;
}

.kb-lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.96);
  transition: transform var(--transition-normal);
}

.kb-lightbox-overlay.active .kb-lightbox-container {
  transform: scale(1);
}

.kb-lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.kb-lightbox-caption {
  color: #f8fafc;
  font-size: 0.9375rem;
  margin-top: 1rem;
  text-align: center;
  max-width: 800px;
}

.kb-lightbox-close {
  position: absolute;
  top: -45px;
  right: 0;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.kb-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Sidebar Table of Contents */
.kb-sidebar-toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-left: 1rem;
  border-left: 1px solid var(--color-border);
}

.kb-toc-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.kb-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.kb-toc-item {
  margin-bottom: 0.4rem;
}

.kb-toc-item.level-3 {
  padding-left: 0.85rem;
}

.kb-toc-link {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-decoration: none;
  line-height: 1.4;
  transition: all var(--transition-fast);
  padding: 0.2rem 0;
}

.kb-toc-link:hover {
  color: var(--primary);
}

.kb-toc-link.active {
  color: var(--primary);
  font-weight: 600;
}

/* Article Helpfulness Feedback Box */
.kb-feedback-card {
  margin-top: 3.5rem;
  padding: 2rem;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.kb-feedback-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 0.5rem;
}

.kb-feedback-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.kb-feedback-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.kb-feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
  background: #ffffff;
  color: var(--color-text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.kb-feedback-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.kb-feedback-btn.yes:hover {
  background: #f0fdf4;
  color: #166534;
  border-color: #86efac;
}

.kb-feedback-btn.no:hover {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fca5a5;
}

/* Live Global Search Modal */
.kb-search-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 1rem;
}

.kb-search-modal-backdrop.active {
  display: flex;
}

.kb-search-modal {
  width: 100%;
  max-width: 680px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.kb-search-modal-input-wrap {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  gap: 0.75rem;
}

.kb-search-modal-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.125rem;
  font-family: var(--font-sans);
  color: var(--color-text-main);
}

.kb-search-modal-results {
  max-height: 420px;
  overflow-y: auto;
  padding: 0.75rem;
}

.kb-search-item {
  display: block;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background-color var(--transition-fast);
}

.kb-search-item:hover,
.kb-search-item.selected {
  background-color: #f1f5f9;
}

.kb-search-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.kb-search-item-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.kb-search-item-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-main);
}

.kb-search-item-snippet {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.kb-search-mark {
  background: #fef08a;
  color: #854d0e;
  padding: 0.05rem 0.2rem;
  border-radius: 2px;
  font-weight: 600;
}

/* Footer */
.kb-footer {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  background: #ffffff;
  padding: 2.5rem 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.kb-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .kb-article-layout {
    grid-template-columns: 1fr;
  }
  .kb-sidebar-toc {
    display: none;
  }
  .kb-hero-title {
    font-size: 2.125rem;
  }
}

/* Mobile Navigation Drawer & Hamburger Menu */
.kb-mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.4rem;
  color: var(--color-text-main);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.kb-mobile-menu-btn:hover {
  background: #f1f5f9;
}

.kb-mobile-nav-drawer {
  display: none;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.kb-mobile-nav-drawer.active {
  display: block;
}

.kb-mobile-nav-body {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kb-mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.kb-mobile-nav-item:hover, .kb-mobile-nav-item.active {
  background: #f1f5f9;
  color: var(--primary);
}

@media (max-width: 768px) {
  .kb-nav-links {
    display: none !important;
  }
  .kb-mobile-menu-btn {
    display: inline-flex;
  }
  .kb-header-search-btn {
    min-width: unset;
    padding: 0.45rem 0.75rem;
    gap: 0.4rem;
  }
  .kb-kbd-pill {
    display: none;
  }
}

@media (max-width: 640px) {
  .kb-hero {
    padding: 2.25rem 0 1.75rem;
  }
  .kb-hero-title {
    font-size: 1.625rem;
    line-height: 1.25;
    padding: 0 0.5rem;
  }
  .kb-hero-subtitle {
    font-size: 0.9375rem;
    padding: 0 0.5rem;
    margin-bottom: 1.25rem;
  }
  .kb-search-container {
    padding: 0 0.25rem;
  }
  .kb-search-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-radius: 16px;
    padding: 0.75rem;
    gap: 0.65rem;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }
  .kb-search-input-group {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0.25rem 0.25rem 0.25rem 0.5rem;
  }
  .kb-search-input {
    font-size: 1rem;
  }
  .kb-search-actions-group {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .kb-search-scope-select {
    display: block !important;
    flex: 1;
    margin-right: 0;
    height: 44px;
    border-radius: 8px;
    font-size: 0.875rem;
    padding: 0 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--color-border);
  }
  .kb-search-btn {
    height: 44px;
    padding: 0 1.25rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    min-width: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .kb-filter-pills {
    margin-top: 1rem;
    gap: 0.35rem;
  }
  .kb-pill {
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .kb-header-inner {
    height: 60px;
    gap: 0.5rem;
    padding: 0 0.75rem;
  }
  .kb-brand-badge {
    display: none;
  }
  .kb-brand {
    font-size: 1.0625rem;
    gap: 0.45rem;
  }
  .kb-header-search-text {
    display: none;
  }
  .kb-header-search-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .kb-header-auth-btn {
    font-size: 0.8125rem;
    padding: 0.35rem 0.65rem;
  }
}

/* ==========================================================================
   Form Controls & Button System (Shared)
   ========================================================================== */
.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.45rem;
  letter-spacing: -0.01em;
}

.form-input-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.form-input-icon {
  position: absolute;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: #94a3b8;
  pointer-events: none;
  transition: color 180ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.form-control {
  width: 100%;
  height: 46px;
  padding: 0.65rem 1rem 0.65rem 2.65rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: #0f172a;
  background-color: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  outline: none;
  transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.form-control.has-toggle {
  padding-right: 2.85rem;
}

.form-control::placeholder {
  color: #94a3b8;
}

.form-control:hover {
  border-color: #cbd5e1;
}

.form-control:focus {
  border-color: #2563eb;
  background-color: #ffffff;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.12), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.form-input-group:focus-within .form-input-icon {
  color: #2563eb;
}

.form-password-toggle {
  position: absolute;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 150ms ease;
  z-index: 2;
}

.form-password-toggle:hover {
  color: #334155;
  background-color: #f1f5f9;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 46px;
  padding: 0 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  color: #ffffff;
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 150ms ease;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* ==========================================================================
   Auth & Login Experience
   ========================================================================== */
.auth-page-container {
  min-height: calc(100vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1.25rem 5.5rem;
  background: 
    radial-gradient(ellipse 60% 40% at 50% 10%, rgba(37, 99, 235, 0.08) 0%, transparent 80%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(234, 88, 12, 0.04) 0%, transparent 70%),
    var(--color-bg);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 18px;
  padding: 2.5rem;
  box-shadow: 
    0 20px 30px -8px rgba(15, 23, 42, 0.07),
    0 4px 6px -2px rgba(15, 23, 42, 0.03),
    0 0 0 1px rgba(226, 232, 240, 0.5);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #38bdf8, #ea580c);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-emblem {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.12);
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.35rem;
  line-height: 1.4;
}

.auth-alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  line-height: 1.4;
}

.auth-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: #475569;
  font-size: 0.84rem;
  font-weight: 500;
  user-select: none;
}

.auth-checkbox {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  border: 1.5px solid #cbd5e1;
  accent-color: #2563eb;
  cursor: pointer;
}

.demo-credentials-box {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed #e2e8f0;
}

.demo-credentials-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.demo-role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.demo-role-card {
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: all 180ms ease;
  position: relative;
  overflow: hidden;
}

.demo-role-card:hover {
  background: #ffffff;
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.demo-role-card.active {
  background: #eff6ff;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.demo-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f172a;
}

.demo-role-desc {
  font-size: 0.6875rem;
  color: #64748b;
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Industrial-Grade Product Portal & Knowledge Base Hub
   ========================================================================== */

.kb-product-hero {
  position: relative;
  padding: 4rem 0 3.5rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
  background-color: var(--color-surface);
}

.kb-product-hero-bg-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.kb-product-hero-content {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
}

/* Quickstart / Featured Cards */
.kb-quickstart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.kb-quickstart-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  overflow: hidden;
}

.kb-quickstart-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--product-brand, var(--primary));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.kb-quickstart-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.kb-quickstart-card:hover::before {
  opacity: 1;
}

.kb-quickstart-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.kb-badge-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.kb-badge-reading-time {
  font-size: 0.75rem;
  color: var(--color-text-subtle);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.kb-quickstart-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text-main);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.kb-quickstart-excerpt {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 1.25rem;
}

.kb-quickstart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-border-subtle);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Category Modern Directory */
.kb-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
}

.kb-cat-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.kb-cat-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.kb-cat-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.kb-cat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kb-cat-icon-wrap svg {
  width: 22px;
  height: 22px;
}

.kb-cat-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-main);
  line-height: 1.3;
}

.kb-cat-desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-top: 0.25rem;
}

.kb-cat-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.kb-cat-item-link {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: var(--color-text-main);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-fast);
  padding: 0.25rem 0;
}

.kb-cat-item-link:hover {
  color: var(--primary);
}

.kb-cat-item-arrow {
  color: var(--color-text-subtle);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.kb-cat-item-link:hover .kb-cat-item-arrow {
  transform: translateX(3px);
  color: var(--primary);
}


