/* ================================================
   ARTICLE / SINGLE PAGE STYLES
   ================================================ */

/* ── Page Header ──────────────────────────────── */
.page-header {
  position: relative;
  padding: calc(var(--nav-h) + 60px) 0 60px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  min-height: 180px;
  box-sizing: border-box;
}
.page-header-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  contain: paint;
}
.page-header-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 800px;
}
.page-icon { font-size: 2.5rem; line-height: 1; }

/* ── Article Header ──────────────────────────── */
.article-header {
  position: relative;
  padding: calc(var(--nav-h) + 60px) 0 60px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  min-height: 180px;
  box-sizing: border-box;
}
.article-header-content {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.article-header-content .portfolio-tech {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
/* ── Multi-level Breadcrumbs & Back Navigation ── */
.breadcrumb-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  width: 100%;
}
.page-header-content .breadcrumb-wrapper {
  align-items: flex-start;
  margin-bottom: 12px;
}
.breadcrumbs {
  display: flex;
  justify-content: center;
}
.page-header-content .breadcrumbs {
  justify-content: flex-start;
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.page-header-content .breadcrumbs ol {
  justify-content: flex-start;
}
.page-header-content .parent-quick-back {
  justify-content: flex-start;
}
.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  font-size: .82rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.breadcrumb-link {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  transition: color .2s ease;
}
.breadcrumb-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.breadcrumb-icon {
  font-size: .9rem;
}
.breadcrumb-sep {
  color: rgba(255, 255, 255, 0.25);
  margin: 0 4px;
  font-weight: 300;
  user-select: none;
}
.breadcrumb-current {
  color: var(--text);
  font-weight: 500;
  max-width: 380px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Back Parent Pill Button */
.parent-quick-back {
  display: flex;
  justify-content: center;
}
.back-parent-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(124, 106, 247, 0.08);
  border: 1px solid rgba(124, 106, 247, 0.24);
  padding: 5px 14px 5px 10px;
  border-radius: 99px;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all .25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.back-parent-pill:hover {
  background: rgba(124, 106, 247, 0.18);
  border-color: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 106, 247, 0.25);
}
.back-pill-icon {
  transition: transform .2s ease;
}
.back-parent-pill:hover .back-pill-icon {
  transform: translateX(-3px);
}
.back-pill-label {
  background: var(--accent);
  color: #ffffff;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.2;
}
.back-pill-title {
  color: var(--text);
  font-weight: 600;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar Parent Section Box */
.sidebar-parent-box {
  margin-bottom: 20px;
}
.sidebar-parent-link {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(124, 106, 247, 0.08) 0%, rgba(59, 130, 246, 0.04) 100%);
  border: 1px solid rgba(124, 106, 247, 0.22);
  text-decoration: none;
  transition: all .2s ease;
}
.sidebar-parent-link:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(124, 106, 247, 0.16) 0%, rgba(59, 130, 246, 0.1) 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.sidebar-parent-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.sidebar-parent-icon {
  font-size: .95rem;
}
.sidebar-parent-tag {
  font-size: .7rem;
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sidebar-parent-arrow {
  color: var(--accent);
  font-weight: bold;
  font-size: .85rem;
  transition: transform .2s ease;
}
.sidebar-parent-link:hover .sidebar-parent-arrow {
  transform: translate(-2px, -2px);
}
.sidebar-parent-title {
  font-size: .86rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: .84rem;
  font-family: var(--font-mono);
  text-transform: capitalize;
  margin-bottom: 20px;
  transition: color .2s;
}
.back-link:hover { color: var(--accent); }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}
.patent-badge {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: .04em;
  background: rgba(255,212,59,.1);
  border: 1px solid rgba(255,212,59,.3);
  color: #ffd43b;
}

.article-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.25;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}
.article-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Article Layout ──────────────────────────── */
.container.article-layout,
.article-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 250px;
  gap: clamp(24px, 2.5vw, 40px);
  align-items: start;
  padding-top: 40px;
  padding-bottom: 80px;
  max-width: min(94vw, 1680px) !important;
  width: 100%;
  margin: 0 auto;
  padding-left: clamp(16px, 2vw, 36px);
  padding-right: clamp(16px, 2vw, 36px);
}
.article-sidebar {
  grid-column: 1;
  grid-row: 1;
  align-self: stretch; /* Allow sticky children to float correctly */
}
.article-body {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  margin: 0;
}
.article-toc {
  grid-column: 3;
  grid-row: 1;
  align-self: stretch; /* Allow sticky children to float correctly */
}
.article-body--full {
  grid-column: 2;
  max-width: 100%;
  margin: 0;
}

@media (max-width: 1280px) {
  .container.article-layout,
  .article-layout {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 28px;
  }
  .article-toc {
    display: none;
  }
  .article-body {
    grid-column: 2;
  }
}
@media (max-width: 960px) {
  .container.article-layout,
  .article-layout {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-top: 30px;
    padding-left: 20px;
    padding-right: 20px;
  }
  .article-sidebar {
    display: none;
  }
  .article-body {
    grid-column: 1;
  }
}

/* ── Left Sidebar: Article List ───────────────── */
.sidebar-sticky {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.sidebar-title {
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-faint);
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.sidebar-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-link {
  font-size: .84rem;
  color: var(--text-muted);
  transition: var(--transition);
  display: block;
  line-height: 1.4;
}
.sidebar-link:hover {
  color: var(--text);
}
.sidebar-link.active {
  color: var(--accent);
  font-weight: 600;
  border-left: 2px solid var(--accent);
  padding-left: 8px;
  margin-left: -2px;
}

/* ── Table of Contents ──────────────────────── */
.toc-sticky {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.toc-title {
  font-family: var(--font-mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: 14px;
}
.article-toc nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.article-toc nav ul ul {
  padding-left: 14px;
  margin-top: 4px;
}
.article-toc nav a {
  font-size: .82rem;
  color: var(--text-muted);
  transition: color .2s;
  line-height: 1.5;
  display: block;
}
.article-toc nav a:hover { color: var(--accent); }

/* ── Article Body Typography ─────────────────── */
.article-body {
  order: 1;
  min-width: 0;
}
.article-body h2,
.article-body h3,
.article-body h4 {
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 2em 0 .6em;
  line-height: 1.35;
}
.article-body h2 {
  font-size: 1.55rem;
  color: var(--text);
  padding-bottom: .4em;
  border-bottom: 1px solid var(--border);
}
.article-body h3 { font-size: 1.2rem; color: var(--text); }
.article-body h4 { font-size: 1rem; color: var(--text-muted); }

.article-body p {
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 1.2em;
  font-size: 1rem;
}
.article-body strong { color: var(--text); font-weight: 600; }
.article-body em { color: var(--accent-2); font-style: italic; }

.article-body a,
.markdown-body a,
.wi-manual a,
.ti-manual a,
.mi-manual a,
.post-content a {
  color: #38bdf8;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(56, 189, 248, 0.45);
  text-underline-offset: 3px;
  transition: all .2s ease;
}
.article-body a:hover,
.markdown-body a:hover,
.wi-manual a:hover,
.ti-manual a:hover,
.mi-manual a:hover,
.post-content a:hover {
  color: #00e5ff;
  text-decoration-color: #00e5ff;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.45);
}

/* Code */
.article-body code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  color: var(--accent-2);
}
.article-body pre {
  background: var(--surface) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  overflow-x: auto;
  margin: 1.5em 0;
  position: relative;
}
.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: .88rem;
}

/* Tables */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: .9rem;
  table-layout: auto;
  word-break: break-word;
}
.article-body th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--border);
  line-height: 1.6;
  vertical-align: middle;
}
.article-body td {
  padding: 12px 14px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  line-height: 1.6;
  vertical-align: middle;
}
.article-body table .katex-display {
  margin: 0.3em 0 !important;
  min-height: 1.4em;
}
.article-body tr:nth-child(even) td {
  background: rgba(255,255,255,.02);
}

/* Blockquote */
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 14px 20px;
  margin: 1.5em 0;
  background: rgba(124,106,247,.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-body blockquote p {
  color: var(--text-muted);
  margin: 0;
  font-style: italic;
}

/* Lists */
.article-body ul, .article-body ol {
  padding-left: 1.6em;
  margin: 1em 0 1.3em;
  color: var(--text-muted);
  overflow-anchor: auto;
}
.article-body ul { list-style-type: disc; }
.article-body ol { list-style-type: decimal; }
.article-body li {
  margin-bottom: .45em;
  line-height: 1.8;
}
.article-body li > p {
  margin-bottom: .35em;
}

/* Images */
.article-body img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  max-width: 100%;
  height: auto;
  margin: 1.5em 0;
  display: block;
}

/* ── Article Footer ──────────────────────────── */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 40px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.article-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 40px;
}
.article-nav-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: var(--transition);
}
.article-nav-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.article-nav-next { text-align: right; }
.article-nav-parent {
  text-align: center;
  background: linear-gradient(135deg, rgba(124, 106, 247, 0.05) 0%, rgba(59, 130, 246, 0.03) 100%);
  border-color: rgba(124, 106, 247, 0.2);
}
.article-nav-parent:hover {
  background: linear-gradient(135deg, rgba(124, 106, 247, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
  border-color: var(--accent);
}
.article-nav-empty {
  visibility: hidden;
  pointer-events: none;
}
.nav-dir { font-size: .74rem; color: var(--accent); font-family: var(--font-mono); font-weight: 600; }
.nav-title { font-size: .9rem; font-weight: 600; color: var(--text-muted); }
.article-nav-item:hover .nav-title { color: var(--text); }

/* ── List Page ───────────────────────────────── */
.list-container { padding-top: 60px; padding-bottom: 80px; }
.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}
.list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}
.list-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card);
}
.card-accent { height: 3px; }
.accent-simulations           { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.accent-posts                 { background: linear-gradient(90deg, var(--accent-2), #68a063); }
.accent-patents-and-standards { background: linear-gradient(90deg, #ffd43b, #ff9f00); }
.accent-knowledge-base        { background: linear-gradient(90deg, var(--accent-3), #ff9f00); }

.list-card-body { padding: 24px; }
.list-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.list-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
}
.list-card-title a {
  color: var(--text) !important;
  text-decoration: none !important;
  transition: color 0.2s var(--ease-out);
}
.list-card:hover .list-card-title a,
.list-card-title a:hover {
  color: var(--accent) !important;
  text-decoration: none !important;
}
.list-card-summary {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 16px;
}
.list-card-link {
  font-size: .8rem;
  color: var(--accent) !important;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: rgba(124, 106, 247, 0.08);
  border: 1px solid rgba(124, 106, 247, 0.2);
  transition: all 0.2s var(--ease-out);
}
.list-card-link:hover {
  background: rgba(124, 106, 247, 0.18);
  border-color: var(--accent);
  color: var(--text) !important;
  text-decoration: none;
  transform: translateX(4px);
}

/* ── Tools Grid ──────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding-top: 8px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  gap: 20px;
  transition: var(--transition);
}
.tool-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.tool-icon { font-size: 2rem; flex-shrink: 0; }
.tool-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.tool-desc  { font-size: .86rem; color: var(--text-muted); line-height: 1.65; margin-bottom: 16px; }
.tool-wip-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
  background: rgba(255,212,59,.1);
  border: 1px solid rgba(255,212,59,.3);
  color: #ffd43b;
}

/* ── Empty State ─────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ── Footer Nav ──────────────────────────────── */
.footer-nav {
  display: flex;
  gap: 60px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.footer-nav-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-nav-group h4 {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.footer-nav-group a, .footer-nav-group span {
  font-size: .86rem;
  color: var(--text-muted);
  transition: color .2s;
}
.footer-nav-group a:hover { color: var(--text); }
.footer-socials {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.footer-top-link {
  font-size: .82rem;
  color: var(--text-faint);
  transition: color .2s;
}
.footer-top-link:hover { color: var(--accent); }

/* ── Lang active ─────────────────────────────── */
.lang-active { color: var(--accent) !important; }

/* ── Article Copyright ─────────────────────── */
.article-copyright {
  margin-top: 52px;
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: rgba(124, 106, 247, .045);
  color: var(--text-muted);
  font-size: .86rem;
  line-height: 1.8;
}
.global-sponsor-section {
  position: relative;
  width: 100%;
  min-height: 240px;
}
footer.footer,
.footer {
  position: relative;
  width: 100%;
  min-height: 180px;
}
.article-copyright h2 {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 1rem;
}
.article-copyright p { margin: 0 0 10px; }
.article-copyright p:last-child { margin-bottom: 0; }
.article-copyright strong { color: var(--text); }
.article-copyright a {
  color: var(--accent);
  overflow-wrap: anywhere;
}
.article-copyright a:hover { color: var(--accent-light); }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 1280px) {
  .container.article-layout,
  .article-layout {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 28px;
  }
  .article-toc {
    display: none;
  }
  .article-body,
  .article-body--full {
    grid-column: 2;
  }
}
@media (max-width: 960px) {
  .container.article-layout,
  .article-layout {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-top: 30px;
  }
  .article-sidebar {
    display: none;
  }
  .article-body,
  .article-body--full {
    grid-column: 1;
  }
}
@media (max-width: 640px) {
  .breadcrumb-current { max-width: 180px; }
  .back-pill-title { max-width: 150px; }
  .list-grid { grid-template-columns: 1fr; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav-next { text-align: left; }
  .tools-grid { grid-template-columns: 1fr; }
  .article-copyright { margin-top: 38px; padding: 20px; }
}

/* ── GitHub-style Markdown Alerts ── */
.markdown-alert {
  padding: 16px 20px !important;
  margin: 1.5em 0 !important;
  border-radius: var(--radius-sm) !important;
  border-left: 4px solid !important;
  background: rgba(255, 255, 255, 0.02) !important;
}
.markdown-alert p {
  color: var(--text-muted) !important;
  font-style: normal !important;
  line-height: 1.6 !important;
}
.markdown-alert-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.markdown-alert-icon {
  font-size: 1.1rem;
}

/* NOTE Alert */
.markdown-alert-note {
  border-left-color: var(--accent) !important;
  background: rgba(124, 106, 247, 0.04) !important;
}
.markdown-alert-note .markdown-alert-title {
  color: var(--accent);
}

/* TIP Alert */
.markdown-alert-tip {
  border-left-color: #10b981 !important; /* Emerald */
  background: rgba(16, 185, 129, 0.04) !important;
}
.markdown-alert-tip .markdown-alert-title {
  color: #10b981;
}

/* WARNING Alert */
.markdown-alert-warning {
  border-left-color: #f59e0b !important; /* Amber */
  background: rgba(245, 158, 11, 0.04) !important;
}
.markdown-alert-warning .markdown-alert-title {
  color: #f59e0b;
}

/* IMPORTANT Alert */
.markdown-alert-important {
  border-left-color: #3b82f6 !important; /* Blue */
  background: rgba(59, 130, 246, 0.04) !important;
}
.markdown-alert-important .markdown-alert-title {
  color: #3b82f6;
}

/* CAUTION Alert */
.markdown-alert-caution {
  border-left-color: #ef4444 !important; /* Red */
  background: rgba(239, 68, 68, 0.04) !important;
}
.markdown-alert-caution .markdown-alert-title {
  color: #ef4444;
}

/* ── Mermaid CLS Fix ─────────────────────────── */
div.mermaid {
  min-height: 350px; /* Reserve space to prevent CLS when rendering */
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ── Image & Body Layout Constraints ────────────────── */
.article-body img,
.markdown-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.8em auto;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
}

/* ── Featured Simulation Launch Button ────────── */
.sim-launch-cta-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 28px rgba(0, 229, 255, 0.5) !important;
  color: #ffffff !important;
}
.sim-launch-cta-btn:hover span:last-child {
  transform: translateX(4px);
}
@keyframes pulse-dot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Knowledge Base & Blog Sidebar Collapsible Grouping ── */
.sidebar-category-group {
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.sidebar-category-group:last-child {
  margin-bottom: 0;
}
.sidebar-group-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(124, 106, 247, 0.09);
  border: none;
  border-left: 3px solid var(--accent);
  padding: 6px 8px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 0;
  letter-spacing: 0.02em;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}
.sidebar-group-badge:hover {
  background: rgba(124, 106, 247, 0.16);
  color: var(--text);
}
.sidebar-group-badge:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.sidebar-group-badge .badge-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.sidebar-group-badge .badge-icon {
  font-size: 0.88rem;
  flex-shrink: 0;
}
.sidebar-group-badge .badge-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-group-badge .badge-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 6px;
}
.sidebar-group-badge .badge-count {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.sidebar-group-badge:hover .badge-count {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
}
.sidebar-group-badge .badge-chevron {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
}

/* Accordion Open vs Collapsed State */
.sidebar-category-group.is-open .sidebar-group-badge .badge-chevron {
  transform: rotate(0deg);
  color: var(--accent);
}
.sidebar-category-group.is-collapsed .sidebar-group-badge .badge-chevron {
  transform: rotate(-90deg);
}

/* Smooth Accordion Expansion using CSS Grid */
.sidebar-group-content {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, margin 0.25s ease;
  margin-top: 6px;
}
.sidebar-group-content > ul {
  overflow: hidden;
  min-height: 0;
}
.sidebar-category-group.is-collapsed .sidebar-group-content {
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.sidebar-category-group .sidebar-list {
  padding-left: 4px;
  gap: 5px;
}
.sidebar-category-group .sidebar-link {
  font-size: 0.83rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all 0.2s ease;
}
.sidebar-category-group .sidebar-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  padding-left: 10px;
}
.sidebar-category-group .sidebar-link.active {
  color: var(--accent);
  font-weight: 600;
  background: rgba(124, 106, 247, 0.12);
  border-left: 2px solid var(--accent);
}

/* ── Knowledge Base Main Page Grouped Sections ── */
.kb-main-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 32px 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(124, 106, 247, 0.25);
}
.kb-main-group-header .group-icon {
  font-size: 1.5rem;
}
.kb-main-group-header h2 {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}

/* ── KB Featured Module Tip Box ── */
.kb-featured-tip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  background: linear-gradient(135deg, rgba(124, 106, 247, 0.08) 0%, rgba(0, 229, 255, 0.05) 100%);
  border: 1px solid rgba(124, 106, 247, 0.28);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin: 0 0 20px;
  font-size: 0.86rem;
  line-height: 1.5;
}
.kb-featured-tip .tip-tag {
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.kb-featured-tip .tip-desc {
  color: var(--text-muted);
}
.kb-featured-tip .tip-link {
  font-weight: 600;
  color: #00e5ff;
  text-decoration: none;
  transition: all 0.2s ease;
}
.kb-featured-tip .tip-link:hover {
  text-decoration: underline;
  color: #ffffff;
}

/* ================================================
   LIGHT MODE ARTICLE REFINEMENTS
   ================================================ */
[data-theme="light"] .article-body a,
[data-theme="light"] .markdown-body a,
[data-theme="light"] .wi-manual a,
[data-theme="light"] .ti-manual a,
[data-theme="light"] .mi-manual a,
[data-theme="light"] .post-content a,
[data-theme="light"] .content a {
  color: #2563eb;
  text-decoration-color: rgba(37, 99, 235, 0.35);
}
[data-theme="light"] .article-body a:hover,
[data-theme="light"] .markdown-body a:hover,
[data-theme="light"] .wi-manual a:hover,
[data-theme="light"] .ti-manual a:hover,
[data-theme="light"] .mi-manual a:hover,
[data-theme="light"] .post-content a:hover,
[data-theme="light"] .content a:hover {
  color: #1d4ed8;
  text-decoration-color: #1d4ed8;
  text-shadow: none;
}

[data-theme="light"] .article-body tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.02);
}

[data-theme="light"] .article-body pre {
  background: #0f172a !important;
  color: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .article-body blockquote {
  background: rgba(99, 102, 241, 0.06);
  border-left-color: var(--accent);
}

[data-theme="light"] .article-body img[src$=".svg"] {
  background: #080e1a;
  border-color: #cbd5e1;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .sidebar-category-group .sidebar-link:hover {
  color: var(--text);
  background: rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .sidebar-category-group .sidebar-link.active {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

[data-theme="light"] .kb-featured-tip .tip-link {
  color: #2563eb;
}
[data-theme="light"] .kb-featured-tip .tip-link:hover {
  color: #1d4ed8;
}


