/* GamifyEngine Connection Guide — Layout chung (Docs-style, dark theme) */
:root {
  --bg-dark: #0a0b0f;
  --bg-card: #12141c;
  --bg-elevated: #1a1d28;
  --bg-sidebar: #0f1016;
  --bg-header: #0f1016;
  --text: #e8eaef;
  --text-muted: #8b8f9e;
  --accent: #00d4aa;
  --accent-dim: #00a884;
  --accent-glow: rgba(0, 212, 170, 0.35);
  --border: rgba(255, 255, 255, 0.06);
  --font: 'Be Vietnam Pro', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --sidebar-width: 280px;
  --header-height: 56px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ----- Header ----- */
.docs-header {
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.docs-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.docs-header .brand a {
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.docs-header .brand .logo-text {
  background: linear-gradient(135deg, var(--accent), #5eead4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.docs-lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
}

.docs-lang-switcher button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: var(--font);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.docs-lang-switcher button:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}

.docs-lang-switcher button.active {
  background: rgba(0, 212, 170, 0.12);
  color: var(--accent);
  border-color: rgba(0, 212, 170, 0.3);
}

/* ----- Layout: sidebar + main + footer ----- */
.docs-body {
  display: flex;
  flex: 1;
  padding-top: var(--header-height);
  min-height: 100vh;
}

.docs-body.docs-body-footer-injected {
  flex-direction: column;
}

.docs-body.docs-body-footer-injected .docs-body-inner {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ----- Sidebar ----- */
.docs-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  overflow-y: auto;
}

.docs-sidebar nav {
  padding: 0 12px;
}

.docs-sidebar .nav-section {
  margin-bottom: 20px;
}

.docs-sidebar .nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 12px;
  margin-bottom: 4px;
}

.docs-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 8px;
  border-left: 3px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.docs-sidebar .nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.docs-sidebar .nav-link.active {
  color: var(--accent);
  background: rgba(0, 212, 170, 0.06);
  border-left-color: var(--accent);
}

/* Submenu (e.g. Client Admin sections) */
.docs-sidebar .nav-item-with-sub {
  margin-bottom: 4px;
}
.docs-sidebar .nav-item-with-sub > .nav-link-row {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
}
.docs-sidebar .nav-item-with-sub > .nav-link-row > .nav-link {
  flex: 1;
  margin-bottom: 0;
  min-width: 0;
}
.docs-sidebar .nav-item-with-sub .nav-sub-toggle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.2s, transform 0.2s;
}
.docs-sidebar .nav-item-with-sub .nav-sub-toggle:hover {
  color: var(--text);
}
.docs-sidebar .nav-item-with-sub .nav-sub-toggle .nav-sub-chevron {
  display: block;
  transition: transform 0.2s;
}
.docs-sidebar .nav-item-with-sub.collapsed .nav-sub-toggle .nav-sub-chevron {
  transform: rotate(-90deg);
}
.docs-sidebar .nav-item-with-sub.collapsed .nav-sub {
  display: none;
}
.docs-sidebar .nav-item-with-sub > .nav-link {
  margin-bottom: 2px;
}
.docs-sidebar .nav-sub {
  display: flex;
  flex-direction: column;
  padding-left: 12px;
  margin-bottom: 8px;
  border-left: 1px solid var(--border);
  margin-left: 11px;
}
.docs-sidebar .nav-sublink {
  display: block;
  padding: 6px 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.docs-sidebar .nav-sublink:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.docs-sidebar .nav-sublink.active {
  color: var(--accent);
  background: rgba(0, 212, 170, 0.06);
  border-left-color: var(--accent);
}

/* ----- Main content ----- */
.docs-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: calc(100vh - var(--header-height));
  background: var(--bg-card);
  padding: 32px 40px 48px;
}

/* ----- Docs version footer ----- */
.docs-footer {
  flex-shrink: 0;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-header);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.docs-footer .docs-footer-version.lang-en,
.docs-footer .docs-footer-version.lang-vi {
  display: none;
}

.docs-footer .docs-footer-version.lang-vi.active,
.docs-footer .docs-footer-version.lang-en.active {
  display: inline;
  white-space: nowrap;
}

.docs-footer-link {
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}

.docs-footer-link:hover {
  color: var(--accent);
}

.docs-breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.docs-breadcrumb .lang-vi,
.docs-breadcrumb .lang-en {
  display: none;
}

.docs-breadcrumb .lang-vi.active,
.docs-breadcrumb .lang-en.active {
  display: inline;
}

.docs-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.docs-breadcrumb a:hover {
  color: var(--accent);
}

.docs-breadcrumb span {
  margin: 0 6px;
}

.docs-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  line-height: 1.3;
}

.docs-title .lang-vi,
.docs-title .lang-en {
  display: none;
}

.docs-title .lang-vi.active,
.docs-title .lang-en.active {
  display: block;
}

.docs-content {
  max-width: 1000px;
}

.docs-content p {
  margin-bottom: 16px;
  color: var(--text);
}

.docs-content ul, .docs-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.docs-content li {
  margin-bottom: 8px;
}

.docs-content a {
  color: var(--accent);
  text-decoration: none;
}

.docs-content a:hover {
  text-decoration: underline;
}

.docs-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.docs-content pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
}

.docs-content pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

.docs-flow-diagram {
  margin: 16px 0;
  padding: 0;
}
.docs-flow-diagram svg {
  display: block;
  overflow: hidden;
  max-width: 100%;
  height: auto;
}
.docs-flow-diagram .mermaid {
  display: flex;
  justify-content: center;
  margin: 0;
}

.docs-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 12px 0;
  display: block;
}

.docs-content .img-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 20px;
}

/* ----- Audience / Use case / Step-by-step (PM/PO style) ----- */
.docs-audience-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.docs-audience-nav a {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid var(--border);
  color: var(--text-muted);
  transition: all 0.2s;
}

.docs-audience-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.docs-audience-nav a.primary {
  background: rgba(0, 212, 170, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

.docs-section-block {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.docs-section-block h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.docs-use-case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.docs-use-case-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.2s;
}

.docs-use-case-card:hover {
  border-color: rgba(0, 212, 170, 0.3);
}

.docs-use-case-card .icon {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.docs-use-case-card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.docs-use-case-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.docs-steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
  margin: 16px 0 0;
}

.docs-steps li {
  position: relative;
  padding-left: 48px;
  margin-bottom: 20px;
  min-height: 36px;
}

.docs-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: var(--bg-dark);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.docs-steps li strong {
  display: block;
  margin-bottom: 4px;
}

.docs-steps li p, .docs-steps li small {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.docs-steps code {
  font-size: 0.85em;
}

/* Block nội dung theo ngôn ngữ (ẩn/hiện bằng JS) */
.docs-content .lang-vi,
.docs-content .lang-en {
  display: none;
}

.docs-content .lang-vi.active,
.docs-content .lang-en.active {
  display: block;
}

/* Info box (ghi chú, lưu ý) */
.docs-info-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-top: 24px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.docs-info-box .icon {
  color: var(--accent);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.docs-info-box p {
  margin-bottom: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Card / link list trên trang chủ */
.docs-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.docs-card-list a {
  display: block;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: border-color 0.2s, background 0.2s;
}

.docs-card-list a:hover {
  border-color: rgba(0, 212, 170, 0.3);
  background: rgba(0, 212, 170, 0.04);
}

.docs-card-list a small {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Partners page: comparison table & CTA */
.docs-partners-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 20px;
  font-size: 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.docs-partners-table th,
.docs-partners-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.docs-partners-table thead th {
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font-weight: 600;
}

.docs-partners-table tbody tr:last-child td {
  border-bottom: none;
}

.docs-partners-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.docs-cta-block {
  border: 1px solid rgba(0, 212, 170, 0.25);
  background: rgba(0, 212, 170, 0.06);
  border-radius: 8px;
  padding: 20px 24px;
}

.docs-cta-text {
  font-weight: 600;
  margin-top: 12px;
  margin-bottom: 8px;
}

.docs-cta-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.docs-checklist {
  list-style: none;
  padding-left: 0;
  margin: 12px 0 0;
}

.docs-checklist li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.docs-checklist li:last-child {
  border-bottom: none;
}

.docs-checklist-item {
  display: inline-block;
  width: 1.4em;
  margin-right: 8px;
  font-size: 1rem;
  color: var(--text-muted);
}

/* ----- Mobile: menu button (shown only on small screens) ----- */
.docs-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0 -8px 0 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.docs-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.docs-menu-toggle:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Overlay when sidebar is open on mobile */
.docs-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: rgba(0, 0, 0, 0.5);
  z-index: 98;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.docs-sidebar-open .docs-sidebar-overlay {
  display: block;
  opacity: 1;
}

/* ----- Responsive: tablet & mobile ----- */
@media (max-width: 992px) {
  .docs-main {
    padding: 24px 24px 40px;
  }

  .docs-content {
    max-width: 100%;
  }

  .docs-use-case-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
  }

  .docs-header {
    padding: 0 16px;
  }

  .docs-menu-toggle {
    display: flex;
  }

  .docs-body {
    flex-direction: row;
    padding-top: var(--header-height);
  }

  .docs-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: 85vw;
    z-index: 99;
    transform: translateX(-100%);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-right: 1px solid var(--border);
  }

  body.docs-sidebar-open .docs-sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  }

  .docs-main {
    margin-left: 0;
    padding: 16px 16px 32px;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .docs-breadcrumb {
    font-size: 0.8rem;
    margin-bottom: 12px;
    word-break: break-word;
  }

  .docs-title {
    font-size: 1.35rem;
    margin-bottom: 20px;
  }

  .docs-content p,
  .docs-content ul,
  .docs-content ol {
    margin-bottom: 14px;
  }

  .docs-content pre {
    padding: 12px;
    font-size: 0.8rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .docs-content img {
    margin: 10px 0;
  }

  .docs-audience-nav {
    flex-direction: column;
    gap: 8px;
  }

  .docs-audience-nav a {
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  .docs-section-block {
    margin-top: 24px;
    padding-top: 20px;
  }

  .docs-section-block h2 {
    font-size: 1.1rem;
  }

  .docs-steps li {
    padding-left: 44px;
    margin-bottom: 16px;
  }

  .docs-steps li::before {
    width: 26px;
    height: 26px;
    font-size: 0.85rem;
  }

  .docs-info-box {
    padding: 12px 16px;
    margin-top: 20px;
  }

  .docs-card-list a {
    padding: 14px 16px;
  }

  /* Bảng: wrapper cuộn ngang (JS thêm .docs-table-wrap) */
  .docs-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 12px 0;
    border-radius: 8px;
    border: 1px solid var(--border);
  }

  .docs-content .docs-table,
  .docs-content table {
    margin: 0;
    min-width: 100%;
  }

  .docs-content .docs-table th,
  .docs-content .docs-table td,
  .docs-content table th,
  .docs-content table td {
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  body.docs-sidebar-open {
    overflow: hidden;
  }
}

@media (max-width: 480px) {
  .docs-header {
    padding: 0 12px;
  }

  .docs-lang-switcher button {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .docs-main {
    padding: 12px 12px 24px;
  }

  .docs-title {
    font-size: 1.2rem;
  }

  .docs-header .brand .logo-text {
    font-size: 1rem;
  }
}

/* ----- Gallery & Lightbox ----- */
.docs-gallery-section {
  margin: 32px 0;
}
.docs-gallery-card {
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}
.docs-gallery-head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 20px;
}
.docs-gallery-heading {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.docs-gallery-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.docs-gallery-hint-icon {
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300d4aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: 0.9;
}
.docs-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  padding: 24px;
}
.docs-gallery-item {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}
.docs-gallery-item:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 212, 170, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 212, 170, 0.2);
}
.docs-gallery-item:hover .docs-gallery-item-img::after {
  opacity: 1;
}
.docs-gallery-item-img {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
}
.docs-gallery-item-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 212, 170, 0.15);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.docs-gallery-item-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='0.9'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E") center/32px no-repeat;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 1;
  pointer-events: none;
}
.docs-gallery-item:hover .docs-gallery-item-img::before {
  opacity: 1;
}
.docs-gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.docs-gallery-item:hover img {
  transform: scale(1.05);
}
.docs-gallery-item-label {
  display: block;
  padding: 12px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .docs-gallery-section {
    margin: 24px 0;
  }
  .docs-gallery-head {
    padding: 16px 16px 12px;
    flex-direction: column;
    gap: 10px;
  }
  .docs-gallery-heading {
    font-size: 1.1rem;
  }
  .docs-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
  }
  .docs-gallery-item-label {
    padding: 10px 8px;
    font-size: 0.8rem;
  }
}

.docs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: zoom-out;
}
.docs-lightbox.is-open {
  display: flex;
}
.docs-lightbox-content {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: default;
}
.docs-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.docs-lightbox-close:hover {
  background: var(--accent);
  color: var(--bg-dark);
}
.docs-lightbox-prev,
.docs-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 50%;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
  opacity: 0.9;
}
.docs-lightbox-prev:hover,
.docs-lightbox-next:hover {
  background: var(--accent);
  color: var(--bg-dark);
  opacity: 1;
}
.docs-lightbox-prev {
  left: 20px;
}
.docs-lightbox-next {
  right: 20px;
}
.docs-lightbox-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 16px;
  border-radius: 8px;
  pointer-events: none;
}
