/* ============================================================
   XCALIBUR WIKI — Design System
   Charte graphique officielle ChipPC / Xcalibur
   ============================================================ */

/* --- Variables --- */
:root {
  --xc-primary:        #003678;
  --xc-secondary:      #70D4FF;
  --xc-accent:         #E9F8FF;
  --xc-bg:             #fdfeff;
  --xc-surface:        #ffffff;
  --xc-success:        #A6CE39;
  --xc-warning:        #FCB914;
  --xc-danger:         #ec008c;
  --xc-text:           #003678;
  --xc-text-muted:     #6b7f9e;
  --xc-border:         #BDBDBD;
  --xc-border-light:   #e9f8ff;
  --xc-shadow-sm:      0 2px 8px rgba(0,54,120,.10);
  --xc-shadow-md:      0 4px 16px rgba(0,54,120,.15);
  --xc-shadow-lg:      0 8px 32px rgba(0,54,120,.20);
  --xc-radius:         10px;
  --xc-radius-sm:      6px;
  --xc-sidebar-w:      220px;
  --xc-toc-w:          230px;
  --xc-header-h:       58px;
  --xc-font:           'Lato', 'Segoe UI', Arial, sans-serif;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--xc-font);
  background: var(--xc-bg);
  color: var(--xc-text);
  font-size: 15px;
  line-height: 1.65;
}
a { color: var(--xc-primary); text-decoration: none; }
a:hover { color: var(--xc-secondary); text-decoration: underline; }
img { max-width: 100%; border-radius: var(--xc-radius); }
code { font-family: 'Courier New', monospace; background: var(--xc-accent); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
pre { background: #1e2d45; color: #e8f4ff; padding: 18px 20px; border-radius: var(--xc-radius); overflow-x: auto; font-size: 13px; line-height: 1.6; margin: 16px 0; }
pre code { background: none; padding: 0; color: inherit; }

/* ============================================================
   TOP HEADER
   ============================================================ */
.wiki-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--xc-header-h);
  background: var(--xc-primary);
  display: flex; align-items: center;
  padding: 0 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  gap: 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.wiki-header .logo-wrap {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.wiki-header .logo-img { height: 34px; width: auto; }
.wiki-header .brand {
  font-size: 18px; font-weight: 800; color: #fff; letter-spacing: .5px;
}
.wiki-header .brand span { color: var(--xc-secondary); }

.header-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 14px;
}

/* Language switcher */
.lang-switcher {
  display: flex; gap: 4px;
}
.lang-btn {
  padding: 4px 10px; border-radius: 20px; border: 1px solid rgba(255,255,255,.35);
  background: transparent; color: rgba(255,255,255,.75); font-size: 12px;
  font-weight: 700; cursor: pointer; transition: all .2s; text-transform: uppercase; letter-spacing: .5px;
}
.lang-btn:hover, .lang-btn.active {
  background: var(--xc-secondary); border-color: var(--xc-secondary);
  color: var(--xc-primary);
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: text;
  position: relative;
}
.search-wrap .search-ico { flex-shrink: 0; opacity: 0.85; }

/* Full-wiki search results (nav.js) */
.wiki-search-dropdown {
  position: fixed;
  display: none;
  z-index: 200;
  background: var(--xc-surface);
  border-radius: var(--xc-radius);
  box-shadow: var(--xc-shadow-lg);
  border: 1px solid var(--xc-border-light);
  max-height: min(420px, 70vh);
  overflow-y: auto;
  text-align: left;
}
[dir="rtl"] .wiki-search-dropdown { text-align: right; }
.wiki-search-dropdown.open { display: block; }
.wiki-search-dropdown-head {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--xc-text-muted);
  padding: 10px 14px 6px;
  border-bottom: 1px solid var(--xc-border-light);
}
.wiki-search-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}
.wiki-search-dropdown-list a {
  display: block;
  padding: 10px 14px;
  color: var(--xc-text);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.wiki-search-dropdown-list a:hover {
  background: var(--xc-accent);
  border-left-color: var(--xc-secondary);
  text-decoration: none;
}
.wiki-search-dropdown-list a strong {
  display: block;
  font-size: 13px;
  color: var(--xc-primary);
  margin-bottom: 4px;
}
.wiki-search-dropdown-list a span {
  display: block;
  font-size: 12px;
  color: var(--xc-text-muted);
  line-height: 1.45;
  word-break: break-word;
}
.wiki-search-dropdown-empty {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--xc-text-muted);
}
.wiki-search-dropdown-err {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--xc-danger);
}

/* Search in header */
.wiki-search-input {
  padding: 7px 14px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.12); color: #fff;
  font-size: 13px; width: 200px; outline: none;
  transition: all .2s;
}
.wiki-search-input::placeholder { color: rgba(255,255,255,.5); }
.wiki-search-input:focus { background: rgba(255,255,255,.2); border-color: var(--xc-secondary); width: 260px; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.wiki-sidebar {
  position: fixed; top: var(--xc-header-h); left: 0; bottom: 0;
  width: var(--xc-sidebar-w);
  background: var(--xc-surface);
  border-right: 1px solid var(--xc-border-light);
  overflow-y: auto; overflow-x: hidden;
  z-index: 90;
  padding: 12px 0 40px;
  box-shadow: none;
}
.wiki-sidebar::-webkit-scrollbar { width: 4px; }
.wiki-sidebar::-webkit-scrollbar-track { background: var(--xc-accent); }
.wiki-sidebar::-webkit-scrollbar-thumb { background: var(--xc-secondary); border-radius: 2px; }

.nav-section-title {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--xc-text-muted);
  padding: 14px 20px 6px; margin-top: 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 16px;
  color: var(--xc-text); font-size: 13px;
  transition: all .15s; border-left: 3px solid transparent;
  cursor: pointer; text-decoration: none;
}
.nav-item:hover {
  background: var(--xc-accent); color: var(--xc-primary);
  text-decoration: none; border-left-color: var(--xc-secondary);
}
.nav-item.active {
  background: var(--xc-accent); color: var(--xc-primary);
  font-weight: 700; border-left-color: var(--xc-primary);
}
.nav-item svg { flex-shrink: 0; opacity: .75; color: var(--xc-primary); }
.nav-item:hover svg, .nav-item.active svg { opacity: 1; color: var(--xc-primary); }

/* ── Sub-menu ──────────────────────────────────────────────────── */
.nav-item.has-children { justify-content: flex-start; }
.nav-arrow { margin-left: auto; font-size: 10px; opacity: .6; flex-shrink: 0; }
.nav-subitems { display: none; overflow: hidden; }
.nav-subitems.open { display: block; }
.nav-subitem {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 16px 5px 36px;
  color: var(--xc-text); font-size: 12px;
  transition: all .15s; border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-subitem:hover {
  background: var(--xc-accent); color: var(--xc-primary);
  text-decoration: none; border-left-color: var(--xc-secondary);
}
.nav-subitem.active {
  background: var(--xc-accent); color: var(--xc-primary);
  font-weight: 700; border-left-color: var(--xc-primary);
}
.nav-subitem svg { flex-shrink: 0; opacity: .6; color: var(--xc-primary); }
.nav-subitem:hover svg, .nav-subitem.active svg { opacity: 1; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--xc-secondary); color: var(--xc-primary);
  font-size: 10px; font-weight: 800; padding: 2px 7px;
  border-radius: 10px; letter-spacing: .3px;
}
.nav-divider {
  display: flex; align-items: center;
  margin: 10px 12px 2px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,54,120,.18);
}
.nav-divider-logo {
  height: 22px; width: auto;
  opacity: .75;
  display: block;
}

/* ============================================================
   MAIN CONTENT — 3-column layout (sidebar | content | toc)
   ============================================================ */
.wiki-content {
  margin-left: var(--xc-sidebar-w);
  margin-top: var(--xc-header-h);
  min-height: calc(100vh - var(--xc-header-h));
  display: flex;
  align-items: flex-start;
}

/* Inner content body — fills space beside sidebar + optional TOC (all chapters, wide layout) */
.content-inner {
  flex: 1;
  min-width: 0;
  padding: 36px 48px 80px 48px;
  max-width: none;
}

/* Right TOC panel */
.wiki-toc {
  width: var(--xc-toc-w);
  flex-shrink: 0;
  padding: 36px 16px 40px 20px;
  position: sticky;
  top: var(--xc-header-h);
  height: calc(100vh - var(--xc-header-h));
  overflow-y: auto;
  border-left: 1px solid var(--xc-border-light);
}
.wiki-toc::-webkit-scrollbar { width: 3px; }
.wiki-toc::-webkit-scrollbar-thumb { background: var(--xc-border-light); border-radius: 2px; }
.toc-title {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--xc-text-muted);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--xc-border-light);
}
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li { margin-bottom: 2px; }
.toc-list a {
  display: block; font-size: 13px; color: var(--xc-text-muted);
  padding: 5px 8px; border-radius: 6px;
  border-left: 2px solid transparent;
  transition: all .15s; text-decoration: none; line-height: 1.4;
}
.toc-list a:hover { color: var(--xc-primary); background: var(--xc-accent); border-left-color: var(--xc-secondary); text-decoration: none; }
.toc-list a.toc-active { color: var(--xc-primary); font-weight: 700; border-left-color: var(--xc-primary); background: var(--xc-accent); }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  padding: 32px 36px; border-radius: var(--xc-radius);
  background: linear-gradient(135deg, var(--xc-primary) 0%, #0056b3 100%);
  color: #fff; margin-bottom: 36px;
  box-shadow: var(--xc-shadow-md);
  position: relative; overflow: hidden;
}
.page-header::after {
  content: ''; position: absolute; top: -30px; right: -30px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(112,212,255,.12);
}
.page-header .chapter-num {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--xc-secondary); margin-bottom: 8px;
}
.page-header h1 {
  font-size: 28px; font-weight: 900; margin-bottom: 8px;
  line-height: 1.2;
}
.page-header .subtitle {
  font-size: 15px; color: rgba(255,255,255,.8); margin-top: 4px;
}
.page-header .lang-subtitle {
  font-size: 13px; color: rgba(255,255,255,.55); margin-top: 4px;
  font-style: italic;
}

/* ============================================================
   CONTENT SECTIONS
   ============================================================ */
.wiki-section { margin-bottom: 48px; }

h2 {
  font-size: 20px; font-weight: 800; color: var(--xc-primary);
  padding-bottom: 10px; margin-bottom: 20px;
  border-bottom: 2px solid var(--xc-secondary);
  display: flex; align-items: center; gap: 10px;
}
h2 .section-icon { font-size: 20px; }

h3 {
  font-size: 16px; font-weight: 700; color: var(--xc-primary);
  margin: 20px 0 10px;
}
h3::before { content: '▸ '; color: var(--xc-secondary); }

p { margin-bottom: 12px; }

/* ============================================================
   SCREENSHOT
   ============================================================ */
.screenshot-wrap {
  margin: 20px 0 28px;
  border-radius: var(--xc-radius);
  overflow: hidden;
  box-shadow: var(--xc-shadow-md);
  border: 1px solid var(--xc-border-light);
  max-width: 600px;
  cursor: zoom-in;
  transition: box-shadow 0.15s, opacity 0.15s;
}
.screenshot-wrap:hover {
  box-shadow: var(--xc-shadow-lg);
  opacity: 0.92;
}
.screenshot-wrap img {
  display: block; width: 100%; border-radius: 0;
}

/* ── Lightbox overlay ─────────────────────────────────────────── */
#wiki-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 24px;
  box-sizing: border-box;
}
#wiki-lightbox.open {
  display: flex;
}
#wiki-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 6px;
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.7);
  object-fit: contain;
  cursor: zoom-out;
}
#wiki-lightbox-caption {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
#wiki-lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
#wiki-lightbox-close:hover { background: rgba(255,255,255,0.28); }
.screenshot-caption {
  background: var(--xc-accent); padding: 8px 16px;
  font-size: 12px; color: var(--xc-text-muted);
  display: flex; align-items: center; gap: 8px;
  border-top: 1px solid var(--xc-border-light);
}
.screenshot-caption::before { content: ''; }

/* Float screenshot to the right, text wraps left */
.screenshot-side {
  float: right;
  width: 48%;
  margin: 0 0 20px 28px;
  clear: right;
}
/* Clear floats after a section */
.wiki-section::after { content: ''; display: table; clear: both; }

/* Text + image magazine layout */
.media-row {
  display: flex; gap: 28px; align-items: flex-start; margin: 24px 0;
}
.media-row .media-text { flex: 1; min-width: 0; }
.media-row .media-img  { flex: 0 0 46%; }
.media-row .media-img img { border-radius: var(--xc-radius); box-shadow: var(--xc-shadow-md); width: 100%; }
.media-row.img-left .media-img  { order: -1; }
.media-row.img-right .media-img { order: 1; }

/* ============================================================
   TABLES
   ============================================================ */
.wiki-table {
  width: 100%; border-collapse: collapse;
  margin: 16px 0 24px; border-radius: var(--xc-radius);
  overflow: hidden; box-shadow: var(--xc-shadow-sm);
}
.wiki-table thead { background: var(--xc-primary); }
.wiki-table thead th {
  color: #fff; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  padding: 13px 16px; text-align: left;
}
.wiki-table tbody tr { transition: background .15s; }
.wiki-table tbody tr:nth-child(even) { background: var(--xc-accent); }
.wiki-table tbody tr:hover { background: #ddf3ff; }
.wiki-table tbody td {
  padding: 11px 16px; border-bottom: 1px solid var(--xc-border-light);
  vertical-align: top; font-size: 14px;
}
.wiki-table tbody td:first-child { font-weight: 600; }

/* ============================================================
   CARDS (for features grid)
   ============================================================ */
.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px; margin: 20px 0;
}
.xc-card {
  background: var(--xc-surface); border-radius: var(--xc-radius);
  padding: 20px 22px; border: 1px solid var(--xc-border-light);
  box-shadow: var(--xc-shadow-sm); transition: all .2s;
}
.xc-card:hover { box-shadow: var(--xc-shadow-md); transform: translateY(-2px); border-color: var(--xc-secondary); }
.xc-card .card-icon { font-size: 28px; margin-bottom: 10px; display: block; }
.xc-card .card-title { font-size: 15px; font-weight: 700; color: var(--xc-primary); margin-bottom: 6px; }
.xc-card .card-desc { font-size: 13px; color: var(--xc-text-muted); }

/* ============================================================
   CALLOUT BOXES
   ============================================================ */
.callout {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 20px; border-radius: var(--xc-radius-sm);
  margin: 18px 0; border-left: 4px solid;
}
.callout-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.callout-body { flex: 1; }
.callout-body strong { display: block; margin-bottom: 4px; font-size: 14px; }
.callout-body p { margin: 0; font-size: 13px; }
.callout.info    { background: var(--xc-accent); border-color: var(--xc-secondary); }
.callout.warning { background: #fff8e6; border-color: var(--xc-warning); }
.callout.danger  { background: #fff0f7; border-color: var(--xc-danger); }
.callout.success { background: #f5fbea; border-color: var(--xc-success); }

/* ============================================================
   BADGES / PILLS
   ============================================================ */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
}
.badge-primary { background: var(--xc-primary); color: #fff; }
.badge-secondary { background: var(--xc-secondary); color: var(--xc-primary); }
.badge-success { background: var(--xc-success); color: #fff; }
.badge-warning { background: var(--xc-warning); color: #fff; }
.badge-danger  { background: var(--xc-danger);  color: #fff; }
.badge-info    { background: var(--xc-accent);  color: var(--xc-primary); border: 1px solid var(--xc-secondary); }

/* ============================================================
   LANGUAGE SECTIONS
   ============================================================ */
[data-lang]             { display: none; }
[data-lang].lang-visible { display: block; }

/* Inline elements (span, a, strong…) inside headings / breadcrumbs */
span[data-lang].lang-visible,
a[data-lang].lang-visible,
strong[data-lang].lang-visible,
em[data-lang].lang-visible,
code[data-lang].lang-visible { display: inline; }

.lang-block              { display: none; }
.lang-block.lang-visible { display: block; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--xc-text-muted); margin-bottom: 28px;
}
.breadcrumb a { color: var(--xc-text-muted); }
.breadcrumb a:hover { color: var(--xc-primary); }
.breadcrumb .sep { color: var(--xc-border); }

/* ============================================================
   PAGINATION (prev/next)
   ============================================================ */
.page-nav {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 60px; padding-top: 24px;
  border-top: 2px solid var(--xc-border-light);
}
.page-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: var(--xc-radius);
  border: 1px solid var(--xc-border-light);
  background: var(--xc-surface); color: var(--xc-primary);
  font-weight: 700; font-size: 14px;
  box-shadow: var(--xc-shadow-sm); transition: all .2s;
  text-decoration: none; flex: 1; max-width: 48%;
}
.page-nav a:hover { box-shadow: var(--xc-shadow-md); border-color: var(--xc-secondary); transform: translateY(-1px); text-decoration: none; }
.page-nav a.next { justify-content: flex-end; text-align: right; }
.page-nav .nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--xc-text-muted); display: block; }
.page-nav .nav-title { display: none; }
.page-nav .nav-title.lang-visible { display: block; }

/* Inline link button */
.btn-inline {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--xc-primary);
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background .2s, transform .15s;
}
.btn-inline:hover { background: var(--xc-secondary); color: var(--xc-primary) !important; transform: translateY(-1px); }

/* ============================================================
   FOOTER
   ============================================================ */
.wiki-footer {
  background: var(--xc-primary); color: rgba(255,255,255,.5);
  text-align: center; padding: 18px; font-size: 12px;
  margin-left: var(--xc-sidebar-w);
}
.wiki-footer a { color: var(--xc-secondary); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1300px) {
  /* Hide right TOC on medium screens */
  .wiki-toc { display: none; }
}
@media (max-width: 900px) {
  .wiki-sidebar { transform: translateX(-100%); transition: transform .3s; }
  .wiki-sidebar.open { transform: translateX(0); }
  .wiki-content { margin-left: 0; }
  .content-inner { padding: 24px 20px 60px; }
  .wiki-footer { margin-left: 0; }
  /* Keep search usable on small screens (narrow field) */
  .wiki-header .wiki-search-input {
    width: min(160px, 38vw);
    padding: 6px 10px;
    font-size: 12px;
  }
  .wiki-header .wiki-search-input:focus { width: min(220px, 55vw); }
  .menu-toggle { display: flex !important; }
  .screenshot-side { float: none; width: 100%; margin: 16px 0; }
}
.menu-toggle {
  display: none; background: none; border: none; color: #fff;
  font-size: 22px; cursor: pointer; padding: 4px 8px;
}

/* ============================================================
   HOME PAGE HERO
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--xc-primary) 0%, #0a4a9c 60%, #005dc8 100%);
  border-radius: var(--xc-radius); padding: 48px 52px; color: #fff;
  margin-bottom: 40px; position: relative; overflow: hidden;
  box-shadow: var(--xc-shadow-lg);
}
.hero::before {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(112,212,255,.10);
}
.hero::after {
  content: ''; position: absolute; bottom: -40px; right: 80px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(112,212,255,.08);
}
.hero-logo { height: 48px; margin-bottom: 20px; }
.hero h1 { font-size: 34px; font-weight: 900; margin-bottom: 12px; line-height: 1.15; }
.hero h1 span { color: var(--xc-secondary); }
.hero p { font-size: 16px; color: rgba(255,255,255,.8); max-width: 560px; margin-bottom: 28px; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-badge {
  padding: 6px 14px; border-radius: 20px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  font-size: 12px; font-weight: 700; color: rgba(255,255,255,.9);
  letter-spacing: .4px; text-transform: uppercase;
}

/* ============================================================
   INTERACTIVE DEMO PLAYER
   ============================================================ */

/* Featured demo section — prominent placement at top of page */
.demo-featured {
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
  border: 2px solid var(--xc-secondary);
  border-radius: 16px;
  padding: 24px !important;
  margin: 0 0 32px 0 !important;
  box-shadow: 0 4px 20px rgba(0,54,120,.1);
}
.demo-featured h2 {
  color: var(--xc-primary);
  margin-bottom: 16px;
  font-size: 1.1rem;
}
.demo-featured .xc-demo {
  margin: 0 !important;
}

.xc-demo {
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid var(--xc-secondary);
  margin: 32px 0;
  box-shadow: 0 8px 32px rgba(0,54,120,.12);
  background: #fff;
}
.demo-header {
  background: var(--xc-primary);
  color: #fff;
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.demo-title { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.demo-title svg { color: var(--xc-secondary); }
.demo-controls { display: flex; align-items: center; gap: 8px; }
.demo-btn {
  padding: 5px 12px; border-radius: 20px; border: 1.5px solid rgba(255,255,255,.4);
  background: transparent; color: #fff; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all .2s; letter-spacing: .3px;
}
.demo-btn:hover, .demo-btn.play-active { background: var(--xc-secondary); border-color: var(--xc-secondary); color: var(--xc-primary); }
.demo-progress-text { font-size: 12px; color: rgba(255,255,255,.7); white-space: nowrap; }

/* Stage */
.demo-stage { position: relative; background: #f0f7ff; min-height: 320px; overflow: hidden; }
.demo-step { display: none; flex-direction: column; }
.demo-step.active { display: flex; }

/* Progress bar */
.demo-bar {
  height: 3px; background: rgba(0,54,120,.1);
  position: relative;
}
.demo-bar-fill {
  height: 100%; background: var(--xc-secondary);
  transition: width .5s ease;
}

/* Step dots */
.demo-dots {
  display: flex; gap: 6px; justify-content: center; padding: 10px;
  background: #fff; border-top: 1px solid #e9f0f8;
}
.demo-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #d0dff0; cursor: pointer; transition: all .2s;
}
.demo-dot.active { background: var(--xc-primary); transform: scale(1.3); }
.demo-dot.done { background: var(--xc-secondary); }

/* Caption */
.demo-caption {
  padding: 14px 20px 10px;
  background: #fff;
  border-top: 1px solid #e9f0f8;
}
.demo-step-badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  background: var(--xc-primary); color: #fff; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px;
}
.demo-caption p { font-size: 14px; color: #003678; margin: 0; line-height: 1.5; }
.demo-caption strong { color: var(--xc-primary); }

/* ── Mockup UI inside demo stage ───────────────────────── */
.mock-app {
  display: flex; height: 260px; font-family: Lato, sans-serif;
  font-size: 11px; color: #003678;
}
.mock-sidebar {
  width: 120px; flex-shrink: 0;
  background: #E9F8FF;
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 8px;
  border-right: 1px solid #c8e4f8;
}
.mock-logo {
  font-weight: 900; font-size: 12px; color: #003678;
  padding: 4px 6px 10px; border-bottom: 1px solid #c8e4f8; margin-bottom: 6px;
  display: flex; align-items: center; gap: 4px;
}
.mock-logo span { color: #70D4FF; }
.mock-nav {
  padding: 6px 8px; border-radius: 8px; cursor: default;
  display: flex; align-items: center; gap: 6px;
  color: #003678; font-weight: 600; transition: all .3s;
}
.mock-nav.active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,54,120,.15);
  font-weight: 800;
}
.mock-nav.highlight { animation: navPulse 1s ease-in-out infinite alternate; }
@keyframes navPulse {
  from { background: #fff; box-shadow: 0 0 0 0 rgba(112,212,255,.4); }
  to   { background: #E9F8FF; box-shadow: 0 0 0 4px rgba(112,212,255,.5); }
}
.mock-dot { width: 6px; height: 6px; border-radius: 50%; background: #003678; opacity: .4; flex-shrink: 0; }
.mock-dot.active-dot { background: #003678; opacity: 1; }

.mock-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #fdfeff; }
.mock-topbar {
  padding: 8px 14px; border-bottom: 1px solid #e9f0f8;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 900; font-size: 13px; color: #003678;
}
.mock-actions { display: flex; gap: 6px; }
.mock-btn {
  padding: 4px 10px; border-radius: 16px; font-size: 10px; font-weight: 800;
  background: #003678; color: #fff; cursor: default; white-space: nowrap;
}
.mock-btn.secondary { background: transparent; border: 1.5px solid #003678; color: #003678; }
.mock-btn.highlight { animation: btnPulse 1s ease-in-out infinite alternate; }
@keyframes btnPulse {
  from { background: #003678; box-shadow: 0 0 0 0 rgba(0,54,120,.4); }
  to   { background: #0052b4; box-shadow: 0 0 0 6px rgba(0,54,120,.15); }
}
.mock-btn.green { background: #A6CE39; color: #003678; }
.mock-btn.yellow { background: #FCB914; color: #003678; }

.mock-table { flex: 1; overflow: hidden; }
.mock-row {
  display: flex; gap: 0; border-bottom: 1px solid #f0f6ff; padding: 5px 14px;
  align-items: center;
}
.mock-row.header { background: #f5f9ff; font-weight: 800; font-size: 10px; color: #6080a0; border-bottom: 2px solid #e0ecf8; }
.mock-row.selected { background: #e6f2ff; }
.mock-col { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock-col.narrow { flex: 0 0 60px; }
.mock-col.wide { flex: 0 0 100px; }
.mock-status {
  display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 9px; font-weight: 800;
}
.mock-status.online { background: #e6f7e6; color: #1a8a1a; }
.mock-status.offline { background: #ffeaea; color: #c0392b; }
.mock-status.running { background: #fff3cd; color: #856404; }
.mock-status.done { background: #d4edda; color: #155724; }

/* Modal overlay */
.mock-overlay {
  position: absolute; inset: 0; background: rgba(0,54,120,.4);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.mock-modal {
  background: #fff; border-radius: 12px; padding: 16px;
  width: 280px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
  animation: slideUp .3s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.mock-modal-title {
  font-weight: 900; font-size: 13px; color: #003678;
  border-bottom: 1px solid #e9f0f8; padding-bottom: 8px; margin-bottom: 10px;
}
.mock-field { margin-bottom: 8px; }
.mock-label { font-size: 9px; font-weight: 700; color: #6080a0; text-transform: uppercase; margin-bottom: 3px; }
.mock-input {
  width: 100%; padding: 5px 8px; border-radius: 6px;
  border: 1.5px solid #c8d8e8; font-size: 11px; color: #003678;
  box-sizing: border-box; background: #f9fbff;
}
.mock-input.focused { border-color: #003678; box-shadow: 0 0 0 3px rgba(0,54,120,.1); }
.mock-input.typed::after { content: '|'; animation: blink .8s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.mock-select {
  width: 100%; padding: 5px 8px; border-radius: 6px;
  border: 1.5px solid #003678; font-size: 11px; color: #003678; font-weight: 700;
  box-sizing: border-box; background: #e6f2ff;
}
.mock-radio-group { display: flex; flex-direction: column; gap: 4px; }
.mock-radio { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.mock-radio-dot {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid #003678;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.mock-radio-dot.checked::after { content:''; width:5px; height:5px; border-radius:50%; background:#003678; display:block; }
.mock-modal-footer { display: flex; gap: 6px; justify-content: flex-end; margin-top: 12px; padding-top: 10px; border-top: 1px solid #f0f4f8; }
.mock-tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 700;
  background: #e6f2ff; color: #003678; border: 1px solid #c8ddf0;
}
.mock-chip-group { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

/* Cursor animation */
.mock-cursor {
  position: absolute; width: 16px; height: 16px; pointer-events: none;
  z-index: 100; transition: all .6s cubic-bezier(.25,.46,.45,.94);
}
.mock-cursor::before {
  content: '';
  border-left: 8px solid #003678;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  display: block;
}

/* Highlight ring */
.mock-highlight-ring {
  position: absolute; border-radius: 50%;
  border: 2.5px solid #FCB914;
  animation: ringPulse 1.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ringPulse {
  0%   { transform: scale(1);   opacity: 1; }
  50%  { transform: scale(1.2); opacity: .5; }
  100% { transform: scale(1);   opacity: 1; }
}

/* Typing animation */
@keyframes typing {
  from { width: 0; } to { width: 100%; }
}
.mock-typed {
  overflow: hidden; white-space: nowrap; border-right: 1px solid #003678;
  animation: typing .8s steps(20,end) .3s both, blink .8s step-end infinite;
}

/* Step transition */
.demo-step { animation: stepIn .4s ease; }
@keyframes stepIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }

/* ============================================================
   WORKFLOW SCREENSHOT GALLERIES
   ============================================================ */
.workflow-gallery {
  display: flex; flex-direction: column; gap: 20px; margin-top: 16px;
}
.workflow-step {
  display: flex; gap: 16px; align-items: flex-start;
  background: #f8fbff; border-radius: 12px; padding: 16px;
  border: 1px solid #ddeeff;
}
.wf-step-num {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--xc-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 16px; margin-top: 2px;
}
.wf-step-body { flex: 1; min-width: 0; }
.wf-step-label {
  font-size: 14px; font-weight: 700; color: var(--xc-primary);
  margin-bottom: 10px; line-height: 1.4;
}
.wf-img-wrap {
  display: block; position: relative; border-radius: 10px;
  overflow: hidden; border: 2px solid #c8ddf0;
  transition: border-color .2s, box-shadow .2s;
  cursor: zoom-in;
}
.wf-img-wrap:hover { border-color: var(--xc-primary); box-shadow: 0 4px 16px rgba(0,54,120,.2); }
.wf-screenshot {
  display: block; width: 100%; height: auto; max-height: 420px;
  object-fit: cover; object-position: top;
}
.wf-zoom-hint {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,54,120,.75); color: #fff;
  border-radius: 20px; padding: 3px 10px; font-size: 11px;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.wf-img-wrap:hover .wf-zoom-hint { opacity: 1; }

/* Lightbox on click */
.wf-img-wrap.expanded {
  position: fixed; inset: 0; z-index: 9999;
  border-radius: 0; border: none; cursor: zoom-out;
  background: rgba(0,0,0,.85);
  display: flex; align-items: center; justify-content: center;
}
.wf-img-wrap.expanded .wf-screenshot {
  max-height: 90vh; max-width: 90vw; width: auto;
  object-fit: contain; border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0,0,0,.5);
}

/* ============================================================
   REAL VIDEO PLAYER
   ============================================================ */
.video-player-wrap {
  margin: 20px 0 28px;
  border-radius: var(--xc-radius);
  overflow: hidden;
  box-shadow: var(--xc-shadow-lg);
  border: 1px solid var(--xc-border-light);
  background: #000;
}
.video-player-wrap video {
  display: block;
  width: 100%;
  max-height: 480px;
  border-radius: 0;
}
.video-player-caption {
  background: var(--xc-primary);
  color: rgba(255,255,255,.85);
  padding: 10px 18px;
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
}
.video-player-caption svg { flex-shrink: 0; opacity: .8; }
.video-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.15); border-radius: 20px;
  padding: 3px 10px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; margin-left: auto;
}

/* ============================================================
   PROFESSIONAL CONTENT COMPONENTS
   ============================================================ */

/* ── Callout boxes ─────────────────────────────────────────── */
.callout {
  border-radius: 10px; padding: 14px 18px; margin: 16px 0;
  border-left: 4px solid;
  font-size: 14px; line-height: 1.6;
}
.callout-info    { background: #e8f4fd; border-color: #0078d4; color: #003678; }
.callout-warning { background: #fff8e1; border-color: #fa8c16; color: #7c4400; }
.callout-danger  { background: #fff2f0; border-color: #ff4d4f; color: #820014; }
.callout-success { background: #f0f9eb; border-color: #52c41a; color: #135200; }
.callout strong  { font-weight: 700; }

/* ── Tag groups ────────────────────────────────────────────── */
.tag-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  display: inline-block; padding: 3px 12px; border-radius: 20px;
  background: #e8f4fd; color: #003678;
  font-size: 12px; font-weight: 600; border: 1px solid rgba(0,54,120,.15);
}

/* ── Flow diagram (ticket lifecycle) ──────────────────────── */
.flow-diagram {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0; margin: 20px 0;
}
.flow-step {
  background: #f8fbff; border: 1.5px solid var(--xc-border-light);
  border-radius: 10px; padding: 12px 16px; min-width: 120px;
  text-align: center; flex: 1;
}
.flow-step p { font-size: 12px; color: var(--xc-text-muted); margin: 6px 0 0; }
.flow-arrow {
  font-size: 22px; color: var(--xc-secondary); font-weight: 900;
  padding: 0 6px; flex-shrink: 0;
}

/* ── Architecture diagram layers ──────────────────────────── */
.arch-diagram {
  display: flex; flex-direction: column; gap: 6px;
  margin: 20px 0; background: #f8fbff;
  border: 1.5px solid var(--xc-border-light);
  border-radius: 12px; padding: 20px;
}
.arch-layer {
  display: flex; gap: 10px; justify-content: center; align-items: stretch;
}
.arch-box {
  background: #fff; border: 1.5px solid var(--xc-border-light);
  border-radius: 8px; padding: 12px 16px; flex: 1;
  text-align: center;
}
.arch-box strong { display: block; color: var(--xc-primary); font-size: 13px; }
.arch-box small  { font-size: 11px; color: var(--xc-text-muted); }
.arch-box-wide   { flex: 2; }
.arch-layer-top  .arch-box { border-top: 3px solid var(--xc-secondary); }
.arch-layer-bottom .arch-box { border-bottom: 3px solid var(--xc-primary); }

/* ── Info card grid ────────────────────────────────────────── */
.info-card {
  background: #f8fbff; border: 1.5px solid var(--xc-border-light);
  border-radius: 10px; padding: 16px; transition: box-shadow .2s, transform .15s;
}
.info-card:hover { box-shadow: 0 4px 16px rgba(0,54,120,.12); transform: translateY(-2px); }
.info-card-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--xc-primary); display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.info-card-icon svg { color: #fff; fill: #fff; }
.info-card strong { display: block; color: var(--xc-primary); margin-bottom: 4px; font-size: 14px; }
.info-card p { font-size: 13px; color: var(--xc-text-muted); margin: 0; line-height: 1.5; }

/* ── Print button ──────────────────────────────────────────── */
.print-btn {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--xc-primary); color: #fff;
  border: none; border-radius: 50px; padding: 10px 18px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,54,120,.3);
  z-index: 900; transition: transform .15s, background .2s, max-width .3s;
  display: flex; align-items: center; gap: 8px;
  max-width: 280px; overflow: hidden; white-space: nowrap;
  text-overflow: ellipsis;
}
.print-btn:hover { background: #0053a8; transform: translateY(-2px); }
.print-btn svg { flex-shrink: 0; }

/* ============================================================
   PRINT / PDF EXPORT STYLES
   ============================================================ */
@media print {
  /* ── Hide ALL navigation / chrome elements ─────────────────── */
  .wiki-header,
  .wiki-sidebar,
  .wiki-footer,
  .wiki-toc,
  .page-nav,
  .print-btn,
  .menu-toggle,
  .lang-switcher,
  .wiki-search-input,
  .search-wrap,
  .wf-zoom-hint,
  .demo-featured,
  .xc-demo,
  .workflow-gallery,
  .breadcrumb,
  .thinxos-subnav,
  #wikiSearchDropdown,
  #wiki-lightbox {
    display: none !important;
    visibility: hidden !important;
    position: static !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  /* ── Reset page layout ──────────────────────────────────────── */
  body { background: #fff !important; font-size: 11pt; margin: 0 !important; }
  .wiki-content { margin-left: 0 !important; display: block !important; margin-top: 0 !important; }
  .content-inner { padding: 20px 0 0 !important; max-width: 100% !important; }

  /* ── ThinX OS: full-width when sub-nav is hidden ────────────── */
  .thinxos-layout { display: block !important; }
  .thinxos-main   { width: 100% !important; min-width: 0 !important; }

  /* ── Page break rules ───────────────────────────────────────── */
  .wiki-section { page-break-inside: avoid; }
  h1, h2, h3 { page-break-after: avoid; }

  /* ── Print header (one-time, top of page) ───────────────────── */
  .content-inner::before {
    content: 'Xcalibur Global Wiki — ChipPC';
    display: block; text-align: center;
    font-size: 9pt; color: #888;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px; margin-bottom: 24px;
  }

  /* ── Remove decorative effects ──────────────────────────────── */
  * { box-shadow: none !important; transform: none !important; animation: none !important; }

  /* ── Language: show English only ───────────────────────────── */
  [data-lang]:not([data-lang="en"]) { display: none !important; }
  [data-lang="en"] { display: block !important; }
  span[data-lang="en"], a[data-lang="en"] { display: inline !important; }

  /* ── Tables ─────────────────────────────────────────────────── */
  .wiki-table { page-break-inside: auto; }
  .wiki-table tr { page-break-inside: avoid; }

  /* ── Links: NO URL expansion (keep text clean) ──────────────── */
  a::after { content: "" !important; }
}

/* ThinX OS chapter: sticky sub-nav offset matches wiki header height */
main.thinxos-wiki .thinxos-subnav {
  top: calc(var(--xc-header-h) + 12px);
}
