/* ==========================================================================
   TEADMORE DESIGN SYSTEM & UNIFIED STYLESHEET (style.css)
   Distraction-Free Editorial Layout & High-Legibility Technical Typography
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. FOUC Prevention (Hide custom elements until registered)
   -------------------------------------------------------------------------- */
:not(:defined) {
  visibility: hidden;
}

tm-modal:not(:defined),
tm-drawer:not(:defined),
tm-dropdown:not(:defined),
sl-dialog:not(:defined),
sl-details:not(:defined),
sl-dropdown:not(:defined) {
  display: none !important;
}

.is-hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   2. Design Tokens & CSS Variables
   -------------------------------------------------------------------------- */
:root {
  --tm-font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --tm-font-serif: "Newsreader", "Charis SIL", "Charter", "Georgia", "Cambria", serif;
  --tm-font-mono: 'JetBrains Mono', "SFMono-Regular", Consolas, Menlo, monospace;

  /* Light Mode: Archival Paper & Deep Navy */
  --tm-bg-canvas: #f8fafc;
  --tm-bg-surface: #ffffff;
  --tm-bg-subtle: #f1f5f9;
  --tm-bg-hover: #e2e8f0;
  --tm-border-light: #e2e8f0;
  --tm-border-strong: #cbd5e1;

  --tm-text-primary: #0f172a;
  --tm-text-secondary: #334155;
  --tm-text-muted: #64748b;
  --tm-text-dim: #94a3b8;

  --tm-accent-primary: #1e3a5f;
  --tm-accent-hover: #162c46;
  --tm-accent-subtle: #eff6ff;
  --tm-accent-text: #ffffff;
  --tm-accent-navy: #1e3a8a;
  --tm-accent-glow: rgba(30, 58, 138, 0.07);

  --tm-link-blue: #2563eb;
  --tm-grid-color: rgba(15, 23, 42, 0.035);

  --tm-code-bg: #0f172a;
  --tm-code-text: #f8fafc;

  --tm-highlight-bg: #e0f2fe;
  --tm-highlight-color: #0369a1;

  --tm-shadow-subtle: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --tm-shadow-card: 0 4px 14px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.03);
  --tm-shadow-elevated: 0 12px 28px -4px rgba(15, 23, 42, 0.09), 0 6px 10px -4px rgba(15, 23, 42, 0.04);
  --tm-ease-spring: cubic-bezier(0.16, 1, 0.3, 1);

  --sl-color-primary-50: #f0f4f8;
  --sl-color-primary-100: #d9e2ec;
  --sl-color-primary-200: #bcccdc;
  --sl-color-primary-300: #9fb3c8;
  --sl-color-primary-400: #627d98;
  --sl-color-primary-500: #334e68;
  --sl-color-primary-600: #1e3a5f;
  --sl-color-primary-700: #102a43;
  --sl-color-primary-800: #0b1d30;
  --sl-color-primary-900: #06111c;
  --sl-color-primary-text: #ffffff;
}

html.theme-dark,
html.sl-theme-dark {
  color-scheme: dark;
  /* Dark Mode: Deep Obsidian & Electric Slate */
  --tm-bg-canvas: #0b0f17;
  --tm-bg-surface: #111827;
  --tm-bg-subtle: #1a2234;
  --tm-bg-hover: #222d42;
  --tm-border-light: #1e293b;
  --tm-border-strong: #334155;

  --tm-text-primary: #f8fafc;
  --tm-text-secondary: #cbd5e1;
  --tm-text-muted: #94a3b8;
  --tm-text-dim: #64748b;

  --tm-accent-primary: #38bdf8;
  --tm-accent-hover: #7dd3fc;
  --tm-accent-subtle: rgba(56, 189, 248, 0.12);
  --tm-accent-text: #0b0f17;
  --tm-accent-navy: #3b82f6;
  --tm-accent-glow: rgba(59, 130, 246, 0.12);

  --tm-link-blue: #60a5fa;
  --tm-grid-color: rgba(248, 250, 252, 0.03);

  --tm-code-bg: #050811;
  --tm-code-text: #e2e8f0;

  --tm-highlight-bg: rgba(56, 189, 248, 0.18);
  --tm-highlight-color: #7dd3fc;

  --tm-shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.35);
  --tm-shadow-card: 0 4px 16px rgba(0, 0, 0, 0.45);
  --tm-shadow-elevated: 0 14px 32px rgba(0, 0, 0, 0.65);

  --sl-color-primary-500: #38bdf8;
  --sl-color-primary-600: #0ea5e9;
  --sl-color-primary-700: #0284c7;
}

/* --------------------------------------------------------------------------
   3. Global Layout & Reset
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  /* Reserves scrollbar gutter space to prevent horizontal content jumping */
  scrollbar-gutter: stable;
  overflow-y: scroll;
  scrollbar-width: thin;
  scrollbar-color: var(--tm-border-strong) transparent;
  background-color: var(--tm-bg-canvas);
  color-scheme: light;
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--tm-border-strong);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--tm-text-dim);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--tm-font-sans);
  background-color: var(--tm-bg-canvas);
  color: var(--tm-text-primary);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(30, 58, 95, 0.05), transparent 70%),
    linear-gradient(to right, rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 36px 36px, 36px 36px;
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
  position: relative;
}

html.theme-dark body,
html.sl-theme-dark body {
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(56, 189, 248, 0.06), transparent 70%),
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
}

/* Centered container for landing & search view */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  max-width: 720px;
  transition:
    max-width 0.45s var(--tm-ease-spring),
    margin-left 0.45s var(--tm-ease-spring),
    margin-right 0.45s var(--tm-ease-spring),
    padding 0.45s var(--tm-ease-spring);
}

@media (min-width: 860px) {
  body.is-serp .container {
    max-width: 1220px;
    margin-left: clamp(2rem, 6.5vw, 6.5rem);
    margin-right: auto;
    padding-left: 0;
    padding-right: 2.5rem;
  }
}

/* Informational & documentation page container */
.content-container {
  max-width: 860px;
  width: 100%;
  margin: 2rem auto 4rem auto;
  padding: 0 1.5rem;
  flex: 1;
}

/* --------------------------------------------------------------------------
   4. Navigation & Brand Identity
   -------------------------------------------------------------------------- */
.top-navbar {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
}

/* Sticky top navigation toolbar */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: var(--tm-bg-canvas);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--tm-border-light);
}

.top-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--tm-bg-surface);
  border: 1px solid var(--tm-border-light);
  padding: 0.25rem 0.5rem;
  border-radius: 24px;
  box-shadow: var(--tm-shadow-subtle);
}

/* 1-click micro-segmented theme switcher */
.theme-segmented {
  display: inline-flex;
  align-items: center;
  background: var(--tm-bg-subtle);
  border: 1px solid var(--tm-border-light);
  border-radius: 18px;
  padding: 2px;
  gap: 2px;
}

.theme-seg-btn {
  background: transparent;
  border: none;
  color: var(--tm-text-muted);
  width: 26px;
  height: 24px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
}

.theme-seg-btn:hover {
  color: var(--tm-text-primary);
}

.theme-seg-btn.is-active {
  background: var(--tm-bg-surface);
  color: var(--tm-accent-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: bold;
}

html.theme-dark .theme-seg-btn.is-active,
html.sl-theme-dark .theme-seg-btn.is-active {
  background: #1e293b;
  color: #38bdf8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Unified Language Selector Trigger (Harmonized with .theme-segmented) */
.lang-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  background: var(--tm-bg-subtle);
  border: 1px solid var(--tm-border-light);
  border-radius: 18px;
  color: var(--tm-text-secondary);
  font-family: var(--tm-font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
  user-select: none;
}

.lang-select-btn:hover {
  color: var(--tm-text-primary);
  border-color: var(--tm-border);
  background: var(--tm-bg-surface);
}

tm-dropdown.is-open .lang-select-btn {
  color: var(--tm-accent-primary);
  border-color: var(--tm-accent-primary);
  background: var(--tm-bg-surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.lang-globe-icon {
  font-size: 0.85rem;
  opacity: 0.85;
}

.current-lang-text {
  font-weight: 700;
}

.lang-chevron-icon {
  font-size: 0.75rem;
  opacity: 0.65;
  transition: transform 0.2s ease;
}

tm-dropdown.is-open .lang-chevron-icon {
  transform: rotate(180deg);
  opacity: 1;
}

.control-trigger-btn,
.control-trigger-btn::part(base) {
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--tm-text-secondary);
  font-family: var(--tm-font-mono);
  padding: 0.2rem 0.6rem;
  border-radius: 16px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.control-trigger-btn:hover,
.control-trigger-btn:hover::part(base) {
  color: var(--tm-accent-primary);
  background-color: var(--tm-bg-subtle);
}

.control-divider {
  width: 1px;
  height: 16px;
  background: var(--tm-border-light);
  margin: 0 0.2rem;
}

/* Header & Brand Identity */
.header {
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  padding: clamp(4.5rem, 15vh, 8.5rem) 0 2rem 0;
  transition: padding 0.4s var(--tm-ease-spring), justify-content 0.4s var(--tm-ease-spring);
}

body.is-serp .header {
  padding: 1.25rem 0 0.85rem 0;
  justify-content: flex-start;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  flex-direction: column;
  gap: 0.85rem;
  transition: gap 0.35s var(--tm-ease-spring);
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
}

body.is-serp .brand {
  flex-direction: row;
  gap: 0.75rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon-wrapper {
  position: relative;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--tm-bg-surface);
  border: 1px solid var(--tm-border-light);
  box-shadow: var(--tm-shadow-subtle);
  transition: width 0.35s var(--tm-ease-spring), height 0.35s var(--tm-ease-spring), border-radius 0.35s ease, transform 0.25s var(--tm-ease-spring), border-color 0.2s ease, box-shadow 0.2s ease;
}

body.is-serp .brand-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.brand-icon-wrapper-sm {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.brand:hover .brand-icon-wrapper,
.brand-group:hover .brand-icon-wrapper {
  transform: translateY(-2px);
  border-color: var(--tm-border-strong);
  box-shadow: var(--tm-shadow-card);
}

.brand-astrolabe {
  width: 32px;
  height: 32px;
  color: var(--tm-accent-primary);
  transition: width 0.35s var(--tm-ease-spring), height 0.35s var(--tm-ease-spring);
}

body.is-serp .brand-astrolabe {
  width: 22px;
  height: 22px;
}

.brand-astrolabe-sm {
  width: 22px;
  height: 22px;
}

.brand-title {
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  margin: 0;
  color: var(--tm-text-primary);
  font-family: var(--tm-font-sans);
  transition: font-size 0.35s var(--tm-ease-spring), letter-spacing 0.35s var(--tm-ease-spring);
}

body.is-serp .brand-title {
  font-size: 1.25rem;
  letter-spacing: 0.06em;
}

.brand-title-sm {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  font-family: var(--tm-font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
  background: var(--tm-bg-subtle);
  border: 1px solid var(--tm-border-light);
  color: var(--tm-accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   5. Search Box & Interactive Controls
   -------------------------------------------------------------------------- */
.search-section {
  margin-bottom: 1.5rem;
  position: sticky;
  top: 0.75rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

.search-box {
  width: 100%;
  display: flex;
  align-items: center;
  background: var(--tm-bg-surface);
  border: 1.5px solid var(--tm-border-strong);
  border-radius: 24px;
  box-shadow: var(--tm-shadow-card);
  padding: 0.25rem 0.4rem 0.25rem 1.15rem;
  gap: 0.35rem;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, max-width 0.4s var(--tm-ease-spring);
}

@media (min-width: 860px) {
  body.is-serp .search-box {
    max-width: 760px;
  }
}

.search-box:focus-within {
  border-color: var(--tm-accent-primary);
  box-shadow: 0 0 0 3px var(--tm-accent-subtle), var(--tm-shadow-elevated);
}

.search-box .search-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.search-box .search-icon-prefix {
  color: var(--tm-text-dim);
  font-size: 1.15rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-box .search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--tm-font-sans);
  font-size: 1.05rem;
  color: var(--tm-text-primary);
  height: 44px;
  padding: 0;
  min-width: 0;
}

.search-box .search-input::placeholder {
  color: var(--tm-text-dim);
  opacity: 0.85;
}

.search-box .search-clear-btn {
  background: transparent;
  border: none;
  color: var(--tm-text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
  transition: color 0.15s ease;
}

.search-box .search-clear-btn:hover {
  color: var(--tm-text-primary);
}

.search-box sl-input {
  flex: 1;
  --sl-input-border-width: 0;
  --sl-input-background-color: transparent;
  --sl-input-font-size-large: 1.05rem;
  --sl-input-height-large: 44px;
  --sl-input-font-family: var(--tm-font-sans);
}

.search-box sl-input::part(base) {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
}

.search-box sl-input::part(prefix) {
  color: var(--tm-text-dim);
  font-size: 1.15rem;
  margin-right: 0.65rem;
}

/* Action cluster at the end of search input */
.search-actions-cluster {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.search-action-btn {
  background: transparent;
  border: none;
  color: var(--tm-text-muted);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
  position: relative;
}

.search-action-btn:hover {
  background-color: var(--tm-bg-hover);
  color: var(--tm-text-primary);
}

/* Search submit button */
.search-submit-icon-btn {
  background-color: var(--tm-accent-primary);
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.search-submit-icon-btn:hover {
  opacity: 0.95;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.search-submit-icon-btn:active {
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
}

html.theme-dark .search-submit-icon-btn,
html.sl-theme-dark .search-submit-icon-btn {
  background-color: #38bdf8;
  color: #0b0f17;
}

/* Active state for new tab toggle button */
.search-action-btn.is-active {
  background-color: var(--tm-accent-subtle);
  color: var(--tm-accent-primary);
}

html.theme-dark .search-action-btn.is-active,
html.sl-theme-dark .search-action-btn.is-active {
  background-color: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.search-action-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22c55e;
  display: none;
  box-shadow: 0 0 6px #22c55e;
}

.search-action-btn.is-active .search-action-dot {
  display: block;
}

/* --------------------------------------------------------------------------
   5.1. Search Autocomplete / Suggestions Dropdown
   -------------------------------------------------------------------------- */
.suggestions-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--tm-bg-surface);
  border: 1.5px solid var(--tm-border-strong);
  border-radius: 16px;
  box-shadow: var(--tm-shadow-elevated);
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  z-index: 100;
  max-height: 340px;
  overflow-y: auto;
  backdrop-filter: blur(12px);
}

/* Strictly hide dropdown if empty or has no children */
.suggestions-dropdown:empty {
  display: none !important;
}

/* Display only when populated */
.suggestions-dropdown:not(:empty) {
  display: block;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.15rem;
  font-family: var(--tm-font-sans);
  font-size: 0.95rem;
  color: var(--tm-text-primary);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  user-select: none;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: var(--tm-bg-subtle);
  color: var(--tm-accent-primary);
}

.suggestion-item .suggestion-item-icon {
  font-size: 0.9rem;
  color: var(--tm-text-muted);
  flex-shrink: 0;
}

.suggestion-item .suggestion-item-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-item .suggestion-item-text strong {
  font-weight: 700;
  color: var(--tm-text-primary);
}

/* --------------------------------------------------------------------------
   6. Stats Bar & Typo Suggestion
   -------------------------------------------------------------------------- */
.stats {
  font-family: var(--tm-font-mono);
  font-size: 0.78rem;
  color: var(--tm-text-muted);
  margin-bottom: 1.15rem;
  padding: 0 0.25rem 0.5rem 0.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--tm-border-light);
  max-width: 760px;
}

.stats-count {
  color: var(--tm-text-secondary);
  font-weight: 600;
}

.suggestion-box {
  margin-bottom: 1.25rem;
  font-size: 0.925rem;
  color: var(--tm-text-secondary);
  background: var(--tm-bg-surface);
  border: 1px solid var(--tm-border-light);
  border-left: 3.5px solid var(--tm-accent-primary);
  padding: 0.65rem 1rem;
  border-radius: 8px;
  box-shadow: var(--tm-shadow-subtle);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 760px;
}

.suggestion-icon {
  color: var(--tm-accent-primary);
  font-size: 1.05rem;
}

.suggestion-link {
  font-weight: 700;
  color: var(--tm-accent-primary);
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.suggestion-link:hover {
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   6.1. SERP Viewport & Responsive Grid Layout
   -------------------------------------------------------------------------- */
.serp-viewport {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  min-height: 520px;
  flex: 1;
}

body.is-serp .serp-viewport {
  display: flex;
  animation: tmSlideIn 0.38s var(--tm-ease-spring) forwards;
}

@keyframes tmSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.serp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.75rem;
  width: 100%;
}

@media (min-width: 860px) {
  .serp-grid {
    grid-template-columns: 760px minmax(280px, 340px);
  }
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.knowledge-card {
  background: var(--tm-bg-surface);
  border: 1px solid var(--tm-border-light);
  border-radius: 12px;
  padding: 1.4rem;
  box-shadow: var(--tm-shadow-subtle);
}

.knowledge-card summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.knowledge-card summary::-webkit-details-marker {
  display: none;
}

.knowledge-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--tm-text-primary);
}

.knowledge-card-chevron {
  font-size: 0.85rem;
  color: var(--tm-text-muted);
  transition: transform 0.2s ease;
}

.knowledge-card[open] .knowledge-card-chevron {
  transform: rotate(180deg);
}

.knowledge-card-text {
  font-size: 0.9rem;
  color: var(--tm-text-secondary);
  line-height: 1.6;
  margin-top: 0.65rem;
  margin-bottom: 0.85rem;
}

/* Desktop & tablet (>= 860px): persistent card in right column */
@media (min-width: 860px) {
  .knowledge-card {
    position: sticky;
    top: 5rem;
  }

  .knowledge-card summary {
    cursor: default;
    pointer-events: none;
  }

  .knowledge-card-chevron {
    display: none;
  }
}

/* Mobile (< 860px): Collapsible contextual note positioned above results */
@media (max-width: 859px) {
  .side-panel {
    order: -1;
    margin-bottom: -0.25rem;
    max-width: 760px;
  }

  .knowledge-card {
    padding: 0.75rem 1rem;
    border-left: 3.5px solid var(--tm-accent-primary);
  }

  .knowledge-card summary {
    cursor: pointer;
  }

  .knowledge-card-title {
    font-size: 0.95rem;
  }

  .knowledge-card[open] {
    padding-bottom: 1.15rem;
  }
}

/* --------------------------------------------------------------------------
   6.2. Search Refinements & Research Vectors
   -------------------------------------------------------------------------- */
.serp-refinements-section {
  margin-top: 2rem;
  padding: 1.25rem 1.4rem;
  background: var(--tm-bg-surface);
  border: 1px solid var(--tm-border-light);
  border-radius: 14px;
  box-shadow: var(--tm-shadow-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 760px;
}

.refinements-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--tm-text-primary);
}

.refinements-header sl-icon,
.refinements-header tm-icon {
  color: var(--tm-accent-primary);
  font-size: 1.1rem;
}

.refinements-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.refine-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--tm-bg-subtle);
  border: 1px solid var(--tm-border-light);
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--tm-text-secondary);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  user-select: none;
  font-family: var(--tm-font-sans);
}

.refine-chip:hover {
  background: var(--tm-bg-hover);
  color: var(--tm-accent-primary);
  border-color: var(--tm-border-strong);
  transform: translateY(-1px);
}

.refine-chip sl-icon,
.refine-chip tm-icon {
  font-size: 0.8rem;
  color: var(--tm-text-dim);
}

.refine-chip-filter {
  background: rgba(30, 58, 138, 0.05);
  border-color: rgba(30, 58, 138, 0.2);
  color: var(--tm-accent-navy);
  font-family: var(--tm-font-mono);
  font-size: 0.78rem;
}

html.theme-dark .refine-chip-filter,
html.sl-theme-dark .refine-chip-filter {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--tm-accent-primary);
}

/* --------------------------------------------------------------------------
   6.3. Load More Results Component
   -------------------------------------------------------------------------- */
.serp-load-more {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  max-width: 760px;
}

.load-more-counter {
  font-family: var(--tm-font-mono);
  font-size: 0.775rem;
  color: var(--tm-text-muted);
}

/* --------------------------------------------------------------------------
   7. Structured Knowledge Context & Info Callouts
   -------------------------------------------------------------------------- */
.knowledge-details {
  margin-bottom: 1.5rem;
}

.knowledge-details::part(base) {
  background: var(--tm-bg-surface);
  border: 1px solid var(--tm-border-light);
  border-left: 3.5px solid var(--tm-accent-primary);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--tm-shadow-subtle);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.knowledge-details:hover::part(base) {
  border-color: var(--tm-border-strong);
  border-left-color: var(--tm-accent-primary);
}

.knowledge-details::part(header) {
  padding: 0.75rem 1rem;
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--tm-text-primary);
  background: var(--tm-bg-subtle);
  border-bottom: 1px solid var(--tm-border-light);
}

.knowledge-header {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.knowledge-title-text {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  color: var(--tm-text-primary);
}

.knowledge-badge {
  font-family: var(--tm-font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

.knowledge-badge::part(base) {
  background-color: var(--tm-accent-subtle);
  color: var(--tm-accent-primary);
  border: 1px solid var(--tm-border-light);
}

.knowledge-details::part(content) {
  padding: 1rem 1.15rem;
}

.knowledge-explanation {
  margin: 0 0 0.75rem 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--tm-text-secondary);
}

.knowledge-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.835rem;
  font-family: var(--tm-font-mono);
  font-weight: 600;
  color: var(--tm-accent-primary);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: var(--tm-bg-subtle);
  transition: background-color 0.15s ease;
}

.knowledge-link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   8. Results Cards & Meta-Pills
   -------------------------------------------------------------------------- */
@keyframes tmFadeIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: tmFadeIn 0.22s ease-out;
}

.result-card {
  background: var(--tm-bg-surface);
  border: 1px solid var(--tm-border-light);
  border-radius: 10px;
  padding: 1.15rem 1.35rem;
  box-shadow: var(--tm-shadow-subtle);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.result-card:hover {
  border-color: var(--tm-border-strong);
  box-shadow: var(--tm-shadow-card);
  transform: translateY(-1px);
}

.result-url-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--tm-font-mono);
  font-size: 0.775rem;
  color: var(--tm-text-muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-bottom: 0.15rem;
}

.result-url-icon {
  font-size: 0.8rem;
  color: var(--tm-text-dim);
  flex-shrink: 0;
}

.result-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--tm-text-muted);
}

.result-title {
  font-size: 1.18rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
  font-family: var(--tm-font-sans);
}

.result-title a {
  color: var(--tm-accent-primary);
  text-decoration: none;
  display: inline;
}

.result-title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2.5px;
}

.result-snippet {
  font-size: 0.915rem;
  color: var(--tm-text-secondary);
  line-height: 1.62;
  margin: 0.2rem 0 0.35rem 0;
}

.result-snippet b,
.result-snippet mark {
  background: var(--tm-highlight-bg);
  color: var(--tm-highlight-color);
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
  font-weight: 600;
}

.result-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  margin-top: 0.15rem;
  padding-top: 0.35rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--tm-font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--tm-text-muted);
  background: var(--tm-bg-subtle);
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--tm-border-light);
}

.meta-pill sl-icon,
.meta-pill tm-icon {
  font-size: 0.75rem;
  color: var(--tm-text-dim);
}

/* LLMS.txt Pill: Emerald Green */
.meta-pill-llms {
  color: #059669;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

:host(.theme-dark) .meta-pill-llms,
.theme-dark .meta-pill-llms,
:host(.sl-theme-dark) .meta-pill-llms,
.sl-theme-dark .meta-pill-llms {
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.12);
}

.meta-pill-llms:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.6);
}

/* LLMS-full.txt Pill: Deep Forest Green */
.meta-pill-llms-full {
  color: #047857;
  border-color: rgba(4, 120, 87, 0.45);
  background: rgba(4, 120, 87, 0.12);
  font-weight: 600;
}

:host(.theme-dark) .meta-pill-llms-full,
.theme-dark .meta-pill-llms-full,
:host(.sl-theme-dark) .meta-pill-llms-full,
.sl-theme-dark .meta-pill-llms-full {
  color: #10b981;
  border-color: rgba(4, 120, 87, 0.55);
  background: rgba(4, 120, 87, 0.18);
}

.meta-pill-llms-full:hover {
  background: rgba(4, 120, 87, 0.22);
  border-color: rgba(4, 120, 87, 0.7);
}

/* MCP Static Pill: Warm Amber */
.meta-pill-mcp {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

:host(.theme-dark) .meta-pill-mcp,
.theme-dark .meta-pill-mcp,
:host(.sl-theme-dark) .meta-pill-mcp,
.sl-theme-dark .meta-pill-mcp {
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.12);
}

.meta-pill-mcp:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.6);
}

/* MCP Active Live Server: Gold with active indicator */
.meta-pill-mcp-active {
  color: #92400e;
  border-color: rgba(217, 119, 6, 0.5);
  background: rgba(217, 119, 6, 0.12);
  font-weight: 600;
}

:host(.theme-dark) .meta-pill-mcp-active,
.theme-dark .meta-pill-mcp-active,
:host(.sl-theme-dark) .meta-pill-mcp-active,
.sl-theme-dark .meta-pill-mcp-active {
  color: #fcd34d;
  border-color: rgba(217, 119, 6, 0.6);
  background: rgba(217, 119, 6, 0.2);
}

.meta-pill-mcp-active:hover {
  background: rgba(217, 119, 6, 0.22);
  border-color: rgba(217, 119, 6, 0.75);
}

/* Hybrid Tool Support Pill (LLMS + MCP): Violet / Amethyst */
.meta-pill-hybrid {
  color: #6d28d9;
  border-color: rgba(139, 92, 246, 0.4);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(59, 130, 246, 0.08));
  font-weight: 600;
}

:host(.theme-dark) .meta-pill-hybrid,
.theme-dark .meta-pill-hybrid,
:host(.sl-theme-dark) .meta-pill-hybrid,
.sl-theme-dark .meta-pill-hybrid {
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.5);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.15));
}

.meta-pill-hybrid:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(59, 130, 246, 0.2));
  border-color: rgba(139, 92, 246, 0.7);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  margin-right: 4px;
  box-shadow: 0 0 4px rgba(16, 185, 129, 0.8);
}

button.meta-pill {
  cursor: pointer;
  line-height: inherit;
  font-family: inherit;
}

/* --------------------------------------------------------------------------
   9. Information Cards, Hero Banner & Tech Blocks
   -------------------------------------------------------------------------- */
.page-wrapper {
  max-width: 960px;
  width: 100%;
  margin: 2.5rem auto 6rem auto;
  padding: 0 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hero-banner {
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--tm-border-light);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--tm-font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #10b981;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  color: var(--tm-text-primary);
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--tm-text-secondary);
  line-height: 1.6;
}

/* Quick overview grid: 4 columns in a single row */
.glance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
  width: 100%;
}

.glance-card {
  background: var(--tm-bg-surface);
  border: 1px solid var(--tm-border-light);
  border-radius: 12px;
  padding: 0.85rem 0.85rem;
  box-shadow: var(--tm-shadow-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.glance-card:hover {
  border-color: var(--tm-border-strong);
  transform: translateY(-1px);
}

.glance-label {
  font-size: 0.7rem;
  font-family: var(--tm-font-mono);
  color: var(--tm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.glance-value {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--tm-accent-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.glance-desc {
  font-size: 0.75rem;
  color: var(--tm-text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 768px) {
  .glance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .glance-grid {
    grid-template-columns: 1fr;
  }
}

/* Content cards and documentation blocks */
.info-card {
  background: var(--tm-bg-surface);
  border: 1px solid var(--tm-border-light);
  border-radius: 14px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--tm-shadow-subtle);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  scroll-margin-top: 5rem;
}

.info-card:hover {
  border-color: var(--tm-border-strong);
  box-shadow: var(--tm-shadow-card);
}

/* Subtle hover glow when referencing navigation items */
.info-card.is-hover-highlight {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18), 0 10px 30px -4px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

html.theme-dark .info-card.is-hover-highlight,
html.sl-theme-dark .info-card.is-hover-highlight {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.22), 0 10px 32px -4px rgba(56, 189, 248, 0.15);
}

.card-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--tm-text-primary);
}

.card-icon {
  font-size: 1.35rem;
  color: var(--tm-accent-primary);
}

.card-text {
  font-size: 0.95rem;
  color: var(--tm-text-secondary);
  margin-bottom: 0.85rem;
  line-height: 1.68;
}

.card-text:last-child {
  margin-bottom: 0;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.935rem;
  color: var(--tm-text-secondary);
  line-height: 1.55;
}

.feature-icon {
  color: #10b981;
  font-size: 1.15rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

/* Fixed side table of contents dock */
.right-center-dock {
  position: fixed;
  left: calc(50% + 496px);
  top: clamp(7rem, 12.5vh, 9rem);
  transform: none;
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: var(--tm-bg-surface);
  border: 1.5px solid var(--tm-border-light);
  border-radius: 16px;
  padding: 0.75rem 0.6rem;
  box-shadow: var(--tm-shadow-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  width: 215px;
  max-height: calc(100vh - 10.5rem);
  overflow-y: auto;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.right-center-dock:hover {
  border-color: var(--tm-border-strong);
  box-shadow: var(--tm-shadow-elevated);
}

.dock-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.45rem 0.5rem 0.45rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--tm-border-light);
  font-family: var(--tm-font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--tm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dock-title-row sl-icon,
.dock-title-row tm-icon {
  color: var(--tm-accent-primary);
  font-size: 0.85rem;
}

.dock-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dock-nav-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  font-size: 0.81rem;
  font-weight: 500;
  color: var(--tm-text-secondary);
  text-decoration: none;
  border-left: 2.5px solid transparent;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
  user-select: none;
}

.dock-nav-item:hover {
  color: var(--tm-text-primary);
  background: var(--tm-bg-hover);
}

.dock-nav-item.is-active {
  color: var(--tm-accent-primary);
  font-weight: 700;
  background: var(--tm-accent-subtle);
  border-left-color: var(--tm-accent-primary);
}

html.theme-dark .dock-nav-item.is-active,
html.sl-theme-dark .dock-nav-item.is-active {
  background: rgba(56, 189, 248, 0.15);
  border-left-color: #38bdf8;
  color: #38bdf8;
}

.dock-item-num {
  font-family: var(--tm-font-mono);
  font-size: 0.72rem;
  opacity: 0.7;
}

.dock-item-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile navigation drawer trigger */
.mobile-dock-trigger {
  display: none;
  position: fixed;
  right: 0.85rem;
  left: auto;
  top: clamp(5.5rem, 9.5vh, 7rem);
  transform: none;
  z-index: 95;
  background: var(--tm-bg-surface);
  border: 1.5px solid var(--tm-border-strong);
  border-radius: 24px;
  padding: 0.45rem 0.75rem;
  box-shadow: var(--tm-shadow-elevated);
  cursor: pointer;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--tm-font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tm-text-primary);
  backdrop-filter: blur(12px);
}

.mobile-dock-trigger sl-icon,
.mobile-dock-trigger tm-icon {
  color: var(--tm-accent-primary);
  font-size: 0.95rem;
}

@media (max-width: 1280px) {
  .right-center-dock {
    display: none;
  }

  .mobile-dock-trigger {
    display: inline-flex;
  }
}

/* Code & Syntax Presentation */
.code-box {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid var(--tm-border-strong);
  border-radius: 10px;
  padding: 0.9rem 1.15rem;
  font-family: var(--tm-font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  overflow-x: auto;
  margin: 0.85rem 0;
  position: relative;
}

html.theme-dark .code-box,
html.sl-theme-dark .code-box {
  background: #050811;
  border-color: #1e293b;
}

.code-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.copy-btn {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  font-family: var(--tm-font-sans);
  font-size: 0.75rem;
  transition: background 0.15s, border-color 0.15s;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
}

.method-card {
  margin-top: 1.15rem;
  padding: 1.25rem;
  background: var(--tm-bg-subtle);
  border: 1px solid var(--tm-border-light);
  border-radius: 10px;
}

.method-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--tm-text-primary);
}

.method-badge-easiest {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--tm-font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.28);
  color: var(--tm-link-blue);
  margin-bottom: 0.5rem;
}

.copy-toast {
  position: fixed;
  top: 4.5rem;
  right: 1.5rem;
  background: #10b981;
  color: #ffffff;
  padding: 0.6rem 1.15rem;
  border-radius: 8px;
  font-family: var(--tm-font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--tm-shadow-elevated);
  z-index: 2000;
  display: none;
  align-items: center;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   10. System States: Loading, Zero-Results Guidance, Error
   -------------------------------------------------------------------------- */
.loading-state {
  text-align: center;
  padding: 3.5rem 0;
  min-height: 160px;
}

.loading-state sl-spinner {
  font-size: 2.2rem;
  --track-width: 3px;
  --indicator-color: var(--tm-accent-primary);
  --track-color: var(--tm-border-light);
}

.empty-state-card {
  background: var(--tm-bg-surface);
  border: 1px solid var(--tm-border-light);
  border-radius: 10px;
  padding: 2rem 1.75rem;
  box-shadow: var(--tm-shadow-subtle);
  margin-top: 1rem;
  text-align: left;
}

.empty-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.empty-icon {
  font-size: 1.5rem;
  color: var(--tm-text-dim);
}

.empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--tm-text-primary);
}

.empty-desc {
  font-size: 0.925rem;
  color: var(--tm-text-secondary);
  line-height: 1.6;
  margin: 0 0 1.25rem 0;
}

.empty-guidance {
  background: var(--tm-bg-subtle);
  border: 1px solid var(--tm-border-light);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 0;
  list-style-type: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.885rem;
  color: var(--tm-text-secondary);
}

.empty-guidance li {
  position: relative;
  padding-left: 1.25rem;
  line-height: 1.5;
}

.empty-guidance li::before {
  content: "\2022";
  position: absolute;
  left: 0.25rem;
  color: var(--tm-accent-primary);
  font-weight: bold;
}

.empty-guidance code {
  font-family: var(--tm-font-mono);
  font-size: 0.82rem;
  padding: 0.1rem 0.35rem;
  background: var(--tm-bg-surface);
  border: 1px solid var(--tm-border-light);
  border-radius: 4px;
  color: var(--tm-accent-primary);
}

.error-state {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  color: #ef4444;
  font-size: 0.925rem;
  margin-top: 1rem;
  font-family: var(--tm-font-mono);
}

/* --------------------------------------------------------------------------
   11. Dialogs, Tooltips & Modals
   -------------------------------------------------------------------------- */
.tips-dialog-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.92rem;
  color: var(--tm-text-secondary);
  line-height: 1.55;
}

.tips-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: var(--tm-bg-subtle);
  border: 1px solid var(--tm-border-light);
}

.tips-item-icon {
  font-size: 1.15rem;
  color: var(--tm-accent-primary);
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.tips-item code {
  font-family: var(--tm-font-mono);
  font-size: 0.825rem;
  background: var(--tm-bg-surface);
  border: 1px solid var(--tm-border-light);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: var(--tm-accent-primary);
}

/* --------------------------------------------------------------------------
   12. Structural Footers
   -------------------------------------------------------------------------- */
.footer {
  margin-top: clamp(5rem, 14vh, 9rem);
  padding: 2.5rem 0 3rem 0;
  width: 100%;
  border-top: 1px solid var(--tm-border-light);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.85rem;
  transition: align-items 0.4s var(--tm-ease-spring);
}

body.is-serp .footer {
  align-items: flex-start;
  max-width: 760px;
}

.footer-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.privacy-btn {
  color: var(--tm-text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.825rem;
  font-weight: 500;
  font-family: var(--tm-font-mono);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  background: var(--tm-bg-surface);
  border: 1px solid var(--tm-border-light);
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.privacy-btn:hover {
  color: var(--tm-accent-primary);
  border-color: var(--tm-accent-primary);
  box-shadow: var(--tm-shadow-subtle);
}

.stats-indicator {
  font-family: var(--tm-font-mono);
  font-size: 0.775rem;
  color: var(--tm-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.95rem;
  border-radius: 20px;
  background: var(--tm-bg-surface);
  border: 1px solid var(--tm-border-light);
  letter-spacing: -0.01em;
  user-select: none;
  box-shadow: var(--tm-shadow-subtle);
}

.bot-footer {
  border-top: 1px solid var(--tm-border-light);
  padding: 2.5rem 1rem 3.5rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--tm-text-muted);
  background: var(--tm-bg-canvas);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
}

.footer-link {
  color: var(--tm-text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-link:hover {
  color: var(--tm-link-blue);
}

/* --------------------------------------------------------------------------
   13. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {

  #newtab-toggle,
  #tips-button {
    display: none;
  }

  .search-box {
    padding: 0.25rem 0.4rem 0.25rem 0.9rem;
  }

  .search-box sl-input::part(prefix) {
    margin-right: 0.4rem;
  }

  .top-navbar {
    top: 0.75rem;
    right: 0.75rem;
  }

  body.is-serp .brand-title {
    font-size: 1.15rem;
  }

  .top-bar {
    padding: 0.6rem 1rem;
  }

  .header {
    padding: 2rem 0 1.25rem 0;
  }

  .brand-title {
    font-size: 1.65rem;
  }

  .result-card {
    padding: 1rem;
  }

  .content-container {
    margin: 1.25rem auto 3rem auto;
    padding: 0 1rem;
  }

  .hero-title {
    font-size: 1.55rem;
  }
}

@media (max-width: 420px) {
  .top-controls {
    padding: 0.15rem 0.35rem;
    gap: 0.2rem;
  }

  .theme-seg-btn {
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
  }

  .control-trigger-btn,
  .control-trigger-btn::part(base) {
    padding: 0.15rem 0.4rem;
    height: 24px;
    font-size: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   14. Targeted Icon Accent Colors & Specificity Overrides
   -------------------------------------------------------------------------- */

/* Privacy shield icon - pure emerald green */
tm-icon[name="shield-check"],
sl-icon[name="shield-check"],
tm-icon[name="shield"],
sl-icon[name="shield"],
.card-icon-shield,
.hero-badge tm-icon,
.hero-badge sl-icon {
  color: #10b981 !important;
}

/* TeadmoreBot crawler icon - vibrant blue in light mode, cyan in dark mode */
tm-icon[name="robot"],
sl-icon[name="robot"],
.card-icon-bot {
  color: #2563eb !important;
}

html.theme-dark tm-icon[name="robot"],
html.sl-theme-dark tm-icon[name="robot"],
html.sl-theme-dark sl-icon[name="robot"],
html.sl-theme-dark .card-icon-bot {
  color: #38bdf8 !important;
}

/* Knowledge base cards & contextual callouts - warm amber/gold */
.knowledge-card tm-icon,
.knowledge-card sl-icon,
.knowledge-details tm-icon,
.knowledge-details sl-icon,
.knowledge-card-title tm-icon,
.knowledge-card-title sl-icon,
.knowledge-title-text tm-icon,
.knowledge-title-text sl-icon,
tm-icon[name="lightbulb"],
sl-icon[name="lightbulb"],
tm-icon[name="book"],
sl-icon[name="book"] {
  color: #f59e0b !important;
}

html.theme-dark .knowledge-card tm-icon,
html.sl-theme-dark .knowledge-card tm-icon,
html.sl-theme-dark .knowledge-card sl-icon,
html.theme-dark .knowledge-details tm-icon,
html.sl-theme-dark .knowledge-details tm-icon,
html.sl-theme-dark .knowledge-details sl-icon,
html.theme-dark .knowledge-card-title tm-icon,
html.sl-theme-dark .knowledge-card-title tm-icon,
html.sl-theme-dark .knowledge-card-title sl-icon,
html.theme-dark .knowledge-title-text tm-icon,
html.sl-theme-dark .knowledge-title-text tm-icon,
html.sl-theme-dark .knowledge-title-text sl-icon,
html.theme-dark tm-icon[name="lightbulb"],
html.sl-theme-dark tm-icon[name="lightbulb"],
html.sl-theme-dark sl-icon[name="lightbulb"],
html.theme-dark tm-icon[name="book"],
html.sl-theme-dark tm-icon[name="book"],
html.sl-theme-dark sl-icon[name="book"] {
  color: #fbbf24 !important;
}

/* --------------------------------------------------------------------------
   15. Teadmore Micro-UI (tm-ui) Components: Modal, Drawer, Dropdown & Buttons
   -------------------------------------------------------------------------- */

/* Base Custom Elements */
tm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1;
  pointer-events: none;
}

tm-icon svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

/* Modal Dialogs (<tm-modal> & native <dialog>) */
tm-modal dialog.tm-modal-dialog,
dialog.tm-modal-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 99999;
  background-color: var(--tm-bg-surface);
  border: 1px solid var(--tm-border-light);
  border-radius: 12px;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--tm-border-light);
  color: var(--tm-text-primary);
  max-width: 520px;
  width: calc(100% - 2rem);
  font-family: var(--tm-font-sans);
  padding: 0;
  overflow: hidden;
}

dialog.tm-modal-dialog[open] {
  animation: tmModalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tmModalPop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tm-modal-card {
  display: flex;
  flex-direction: column;
  width: 100%;
}

tm-modal dialog::backdrop,
dialog.tm-modal-dialog::backdrop {
  background-color: rgba(5, 8, 17, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tm-modal-header {
  padding: 1.25rem 1.25rem 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tm-modal-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--tm-text-primary);
  line-height: 1.3;
}

.tm-modal-close-btn {
  background: transparent;
  border: none;
  color: var(--tm-text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.25rem;
  margin-top: -0.25rem;
  margin-right: -0.25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.tm-modal-close-btn:hover {
  color: var(--tm-text-primary);
  background-color: var(--tm-bg-subtle);
}

.tm-modal-body {
  padding: 0.5rem 1.25rem 1.25rem 1.25rem;
  font-size: 0.935rem;
  line-height: 1.6;
  color: var(--tm-text-secondary);
}

.tm-modal-footer {
  padding: 0.75rem 1.25rem 1.25rem 1.25rem;
  display: flex;
  justify-content: flex-end;
}

/* Side Navigation Drawer (<tm-drawer>) */
tm-drawer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

tm-drawer.is-open {
  display: block;
}

.tm-drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(5, 8, 17, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.tm-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background-color: var(--tm-bg-surface);
  border-left: 1px solid var(--tm-border-light);
  box-shadow: var(--tm-shadow-elevated);
  display: flex;
  flex-direction: column;
  z-index: 10000;
  animation: tmDrawerSlide 0.25s var(--tm-ease-spring) forwards;
}

@keyframes tmDrawerSlide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.tm-drawer-header {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--tm-border-light);
}

.tm-drawer-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--tm-text-primary);
}

.tm-drawer-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

body.tm-drawer-active {
  overflow: hidden;
}

/* Dropdown Menus (<tm-dropdown>) */
tm-dropdown {
  position: relative;
  display: inline-block;
}

.tm-dropdown-menu,
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background-color: var(--tm-bg-surface);
  border: 1px solid var(--tm-border-light);
  border-radius: 12px;
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--tm-border-light);
  min-width: 156px;
  padding: 5px;
  z-index: 1000;
  animation: tmDropdownFade 0.15s var(--tm-ease-spring) forwards;
}

@keyframes tmDropdownFade {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

tm-dropdown.is-open .tm-dropdown-menu,
tm-dropdown.is-open .dropdown-menu {
  display: block;
}

.tm-dropdown-item,
.dropdown-item {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--tm-text-secondary);
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  border-radius: 8px;
  font-family: var(--tm-font-sans);
  user-select: none;
}

.tm-dropdown-item:hover,
.dropdown-item:hover {
  background-color: var(--tm-bg-subtle);
  color: var(--tm-text-primary);
}

.tm-dropdown-item.is-selected,
.dropdown-item.is-selected {
  background-color: var(--tm-bg-subtle);
  color: var(--tm-accent-primary);
  font-weight: 700;
}

.lang-flag {
  font-size: 1rem;
  line-height: 1;
}

.lang-name {
  flex: 1;
}

.lang-code {
  font-family: var(--tm-font-mono);
  font-size: 0.75rem;
  opacity: 0.65;
}

/* Lightweight Micro-Spinner (<tm-spinner>) */
tm-spinner,
.tm-spinner,
.loading-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tm-spinner-ring {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--tm-border-light);
  border-top-color: var(--tm-accent-primary);
  border-radius: 50%;
  animation: tmSpin 0.7s linear infinite;
  display: inline-block;
}

@keyframes tmSpin {
  to { transform: rotate(360deg); }
}

/* Universal Button Styles (.btn, .btn-primary, .btn-pill, .btn-sm) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--tm-font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid var(--tm-border-strong);
  background-color: var(--tm-bg-surface);
  color: var(--tm-text-primary);
  padding: 0.45rem 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  line-height: 1.2;
}

.btn:hover {
  background-color: var(--tm-bg-subtle);
  border-color: var(--tm-border-light);
}

.btn-primary {
  background-color: var(--tm-accent-primary);
  color: var(--tm-accent-text);
  border-color: var(--tm-accent-primary);
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--tm-accent-hover);
  border-color: var(--tm-accent-hover);
  transform: translateY(-1px);
}

.btn-pill {
  border-radius: 30px;
  padding: 0.35rem 0.85rem;
  font-size: 0.815rem;
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Legacy sl-dialog fallback compatibility */
sl-dialog::part(overlay) {
  background-color: rgba(5, 8, 17, 0.65);
  backdrop-filter: blur(8px);
}
sl-dialog::part(panel) {
  background-color: var(--tm-bg-surface);
  border: 1px solid var(--tm-border-light);
  border-radius: 12px;
  box-shadow: var(--tm-shadow-elevated);
  color: var(--tm-text-primary);
  max-width: 520px;
}
sl-dialog::part(header) { padding: 1.25rem 1.25rem 0.5rem 1.25rem; }
sl-dialog::part(title) { font-size: 1.2rem; font-weight: 700; color: var(--tm-text-primary); }
sl-dialog::part(body) { padding: 0.5rem 1.25rem 1rem 1.25rem; font-size: 0.935rem; color: var(--tm-text-secondary); }
sl-dialog::part(footer) { padding: 0.75rem 1.25rem 1.25rem 1.25rem; display: flex; justify-content: flex-end; }
sl-dialog::part(close-button) { color: var(--tm-text-muted); font-size: 1.15rem; }

/* --------------------------------------------------------------------------
   16. Semantic Icon Colors & Indicators
   -------------------------------------------------------------------------- */
.icon-green { color: #10b981 !important; }
.icon-darkgreen { color: #059669 !important; }
.icon-amber { color: #f59e0b !important; }
.icon-pink { color: #ec4899 !important; }
.icon-dim { color: var(--tm-text-dim) !important; opacity: 0.65; }
.icon-primary { color: var(--tm-accent-primary) !important; }
.icon-gold { color: #d97706 !important; }
.icon-red { color: #ef4444 !important; }
.icon-lang-prefix { margin-right: 0.35rem; font-size: 0.95rem; }

.footer-icon-green { color: #10b981 !important; }
.footer-icon-navy { color: var(--tm-accent-primary) !important; }
.footer-icon-gold { color: #d97706 !important; }
.footer-icon-chart { color: var(--tm-text-muted) !important; }

/* --------------------------------------------------------------------------
   17. Modal & Dialog Custom Layouts (Privacy, MCP, Search Tips)
   -------------------------------------------------------------------------- */
.tips-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.925rem;
  line-height: 1.55;
  color: var(--tm-text-secondary);
}

.tips-dialog-row {
  display: block;
}

.tips-dialog-row strong {
  color: var(--tm-text-primary);
}

.privacy-dialog-body {
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--tm-text-secondary);
}

.privacy-dialog-lead {
  margin-top: 0;
  margin-bottom: 1.15rem;
}

.privacy-points-list {
  margin: 1.15rem 0 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.privacy-point-item, .mcp-point-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.885rem;
  line-height: 1.5;
}

.privacy-point-icon, .mcp-point-icon {
  color: #10b981;
  font-size: 1.05rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.mcp-dialog-body {
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--tm-text-secondary);
}

.mcp-dialog-lead {
  margin-top: 0;
  margin-bottom: 1.15rem;
}

.mcp-checklist-box {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  background-color: var(--tm-bg-subtle);
  border: 1px solid var(--tm-border-light);
  border-radius: 8px;
}

.mcp-checklist-heading {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--tm-text-primary);
  margin-bottom: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mcp-checklist-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mcp-item-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.865rem;
}

.mcp-status-active {
  color: #10b981;
  font-weight: 600;
}

.mcp-status-static {
  color: #d97706;
  font-weight: 600;
}

.mcp-endpoint-box {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  background-color: var(--tm-bg-subtle);
  border: 1px solid var(--tm-border-light);
  border-radius: 8px;
}

.mcp-endpoint-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tm-text-muted);
  margin-bottom: 0.4rem;
}

.mcp-endpoint-url {
  font-family: var(--tm-font-mono);
  font-size: 0.85rem;
  color: var(--tm-text-primary);
  word-break: break-all;
  user-select: all;
  background-color: var(--tm-bg-surface);
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--tm-border-light);
}

.mcp-endpoint-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.mcp-dialog-link {
  font-size: 0.85rem;
  color: var(--tm-link-blue);
  text-decoration: none;
  font-weight: 500;
}

.mcp-dialog-link:hover {
  text-decoration: underline;
}

.mcp-kb-banner {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  background-color: var(--tm-bg-subtle);
  border: 1px solid var(--tm-border-light);
  border-left: 3.5px solid var(--tm-accent-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.mcp-kb-title {
  display: block;
  font-size: 0.885rem;
  color: var(--tm-text-primary);
}

.mcp-kb-sub {
  font-size: 0.815rem;
  color: var(--tm-text-muted);
}

/* --------------------------------------------------------------------------
   18. Bot & KB Page Utility Classes
   -------------------------------------------------------------------------- */
.card-subheading-sm {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tm-text-primary);
  margin: 0.75rem 0 0.35rem 0;
}

.card-subheading-md {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tm-text-primary);
  margin: 1rem 0 0.45rem 0;
}

.contact-button-container {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.feature-list-mb {
  margin-bottom: 1rem;
}

.footer-copyright {
  font-size: 0.815rem;
  color: var(--tm-text-dim);
}

.mcp-pill-demo {
  margin: 0.75rem 0;
}

.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-drawer-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--tm-text-secondary);
  font-size: 0.9rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mobile-drawer-link:hover,
.mobile-drawer-link.is-active {
  background-color: var(--tm-bg-subtle);
  color: var(--tm-text-primary);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Accessibility: Reduced Motion Guard (anti-ai-design-slop compliance)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}