/**
 * DocuNest - Public Styles
 * Complete frontend CSS for documentation display.
 * Ultra responsive, accessible, production-ready.
 *
 * @package DocuNest
 * @since   1.0.0
 */

/* ==========================================================================
   0. CSS Custom Properties
   ========================================================================== */

:root {
  --docunest-primary: #2563eb;
  --docunest-primary-light: #dbeafe;
  --docunest-primary-dark: #1d4ed8;
  --docunest-text: #1e293b;
  --docunest-text-muted: #64748b;
  --docunest-bg: #ffffff;
  --docunest-bg-secondary: #f8fafc;
  --docunest-border: #e2e8f0;
  --docunest-success: #22c55e;
  --docunest-warning: #f59e0b;
  --docunest-danger: #ef4444;
  --docunest-radius: 8px;
  --docunest-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --docunest-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
  --docunest-transition: 0.2s ease;
  --docunest-sidebar-width: 280px;
  --docunest-max-width: 1200px;
}

/* ==========================================================================
   1. Full Isolation Reset
   Prevents ANY theme or plugin from leaking styles into DocuNest.
   All DocuNest markup lives inside .docunest-wrapper.
   ========================================================================== */

/* Box model reset */
.docunest-wrapper,
.docunest-wrapper *,
.docunest-wrapper *::before,
.docunest-wrapper *::after {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
}

/* Root element */
.docunest-wrapper {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  color: var(--docunest-text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-wrap: break-word;
  overflow-wrap: break-word;
  width: 100%;
  scroll-behavior: smooth;
}

/* ---- Typography reset ---- */

:where(.docunest-wrapper) h1,
:where(.docunest-wrapper) h2,
:where(.docunest-wrapper) h3,
:where(.docunest-wrapper) h4,
:where(.docunest-wrapper) h5,
:where(.docunest-wrapper) h6 {
  font-family: inherit;
  font-weight: 700;
  line-height: 1.3;
  color: var(--docunest-text);
  margin: 0 0 0.6em;
  padding: 0;
  letter-spacing: normal;
  text-transform: none;
  border: none;
}

:where(.docunest-wrapper) p {
  margin: 0 0 1em;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
}

:where(.docunest-wrapper) a {
  color: var(--docunest-primary);
  text-decoration: none;
  transition: color var(--docunest-transition);
  background: none;
  border: none;
  box-shadow: none;
}

:where(.docunest-wrapper) a:hover {
  color: var(--docunest-primary-dark);
  text-decoration: underline;
}

:where(.docunest-wrapper) a:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

:where(.docunest-wrapper) a:focus-visible {
  outline: 2px solid var(--docunest-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

:where(.docunest-wrapper) ul,
:where(.docunest-wrapper) ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

:where(.docunest-wrapper) li {
  margin: 0;
  padding: 0;
}

:where(.docunest-wrapper) img {
  max-width: 100%;
  height: auto;
  border: none;
  display: block;
  box-shadow: none;
}

/* ---- Form elements reset (low specificity via :where) ---- */

:where(.docunest-wrapper) input,
:where(.docunest-wrapper) select,
:where(.docunest-wrapper) textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

:where(.docunest-wrapper) button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  outline: none;
  cursor: pointer;
  text-align: inherit;
  -webkit-appearance: none;
  appearance: none;
}

:where(.docunest-wrapper) input:focus,
:where(.docunest-wrapper) select:focus,
:where(.docunest-wrapper) textarea:focus,
:where(.docunest-wrapper) button:focus {
  box-shadow: none;
  outline: none;
}

.docunest-wrapper input::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.docunest-wrapper input[type="search"]::-webkit-search-cancel-button,
.docunest-wrapper input[type="search"]::-webkit-search-decoration,
.docunest-wrapper input[type="search"]::-webkit-search-results-button,
.docunest-wrapper input[type="search"]::-webkit-search-results-decoration {
  display: none;
  -webkit-appearance: none;
}

.docunest-wrapper select {
  cursor: pointer;
}

.docunest-wrapper button {
  cursor: pointer;
}

/* ---- Table reset ---- */

.docunest-wrapper table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

.docunest-wrapper th,
.docunest-wrapper td {
  text-align: left;
  padding: 0;
  border: none;
}

/* ---- Misc element reset ---- */

.docunest-wrapper figure {
  margin: 0;
}

.docunest-wrapper blockquote {
  margin: 0;
  padding: 0;
}

.docunest-wrapper hr {
  border: none;
  border-top: 1px solid var(--docunest-border);
  margin: 1.5em 0;
}

.docunest-wrapper pre,
.docunest-wrapper code,
.docunest-wrapper kbd {
  font-family: "SF Mono", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
}

.docunest-wrapper mark {
  background: #fef08a;
  color: inherit;
  padding: 1px 3px;
  border-radius: 2px;
}

.docunest-wrapper details {
  margin: 0;
  padding: 0;
}

.docunest-wrapper summary {
  cursor: pointer;
}

/* ---- Dashicons reset (used for icons) ---- */

.docunest-wrapper .dashicons,
.docunest-wrapper [class^="dashicons-"] {
  font-family: dashicons;
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  width: 20px;
  height: 20px;
  font-size: 20px;
  vertical-align: middle;
}

/* Screen-reader only utility */
.docunest-wrapper .screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Search bar styles are injected via print_search_reset_css() in wp_footer */

/* Wrappers */

/*
 * Theme-adaptive container.
 */
.docunest-container {
  max-width: var(--docunest-max-width);
  margin: 0 auto;
  padding: 32px 15px;
}

/* ==========================================================================
   3. Archive / Grid
   ========================================================================== */

.docunest-archive {
  width: 100%;
}

.docunest-archive__header {
  text-align: center;
  margin-bottom: 40px;
}

.docunest-archive__title {
  font-size: 32px;
  font-weight: 800;
  color: var(--docunest-text);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.docunest-archive__desc {
  font-size: 16px;
  color: var(--docunest-text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Search results container */
.docunest-archive__results {
  display: none;
  background: var(--docunest-bg);
  border: 1px solid var(--docunest-border);
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 32px;
  box-shadow: var(--docunest-shadow);
}

.docunest-archive__results h3 {
  font-size: 17px;
  margin: 0;
}

.docunest-no-results {
  text-align: center;
  color: var(--docunest-text-muted);
  font-size: 15px;
  padding: 32px 0;
}

/* Fallback article list (when no categories) */
.docunest-archive__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docunest-archive__list-item {
  border-bottom: 1px solid var(--docunest-border);
}

.docunest-archive__list-item:last-child {
  border-bottom: none;
}

.docunest-archive__list-link {
  display: block;
  padding: 16px 0;
  text-decoration: none;
  transition: background var(--docunest-transition);
}

.docunest-archive__list-link:hover {
  text-decoration: none;
}

.docunest-archive__list-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--docunest-text);
  margin: 0 0 4px;
  transition: color var(--docunest-transition);
}

.docunest-archive__list-link:hover .docunest-archive__list-title {
  color: var(--docunest-primary);
}

.docunest-archive__list-excerpt {
  font-size: 14px;
  color: var(--docunest-text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.docunest-archive__empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--docunest-text-muted);
  font-size: 15px;
}

.docunest-archive__card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.docunest-archive__card-link:hover {
  text-decoration: none;
  color: inherit;
}

/* Grid layout (default) */
.docunest-archive__grid,
.docunest-archive__grid--grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* List layout */
.docunest-archive__grid--list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.docunest-archive__grid--list .docunest-archive__card {
  flex-direction: row;
  align-items: center;
  padding: 16px 20px;
  gap: 16px;
}

.docunest-archive__grid--list .docunest-archive__card-link {
  flex-direction: row;
  align-items: center;
  gap: 16px;
}

.docunest-archive__grid--list .docunest-archive__card-icon {
  margin-bottom: 0;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.docunest-archive__grid--list .docunest-archive__card-title {
  flex: 1;
  margin: 0;
}

.docunest-archive__grid--list .docunest-archive__card-desc {
  display: none;
}

.docunest-archive__grid--list .docunest-archive__card-count {
  margin-top: 0;
  flex-shrink: 0;
}

.docunest-archive__card {
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
  background: var(--docunest-bg);
  border: 1px solid var(--docunest-border);
  border-radius: 12px;
  box-shadow: var(--docunest-shadow);
  transition: transform var(--docunest-transition),
    box-shadow var(--docunest-transition);
  text-decoration: none;
  color: inherit;
}

.docunest-archive__card:hover {
  transform: translateY(-2px);
  box-shadow: var(--docunest-shadow-lg);
  text-decoration: none;
  color: inherit;
}

.docunest-archive__card:focus-visible {
  outline: 2px solid var(--docunest-primary);
  outline-offset: 2px;
}

.docunest-archive__card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--docunest-bg-secondary);
  border-radius: 12px;
  margin-bottom: 16px;
  color: var(--docunest-text-muted);
  flex-shrink: 0;
}

.docunest-archive__card-icon img,
.docunest-archive__card-icon svg {
  width: 24px;
  height: 24px;
}

.docunest-archive__card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--docunest-text);
  margin: 0 0 8px;
  line-height: 1.3;
}

.docunest-archive__card-desc {
  font-size: 14px;
  color: var(--docunest-text-muted);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.docunest-archive__card-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  padding: 4px 10px;
  background: var(--docunest-bg-secondary);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--docunest-text-muted);
  align-self: flex-start;
}

/* ==========================================================================
   3b. Category Page
   ========================================================================== */

.docunest-category {
  width: 100%;
}

.docunest-category__header {
  margin-bottom: 32px;
}

.docunest-category__title {
  font-size: 28px;
  font-weight: 800;
  color: var(--docunest-text);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.docunest-category__desc {
  font-size: 15px;
  color: var(--docunest-text-muted);
  margin: 0;
  line-height: 1.6;
}

.docunest-category__articles {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}

.docunest-category__article {
  border-bottom: 1px solid var(--docunest-border);
}

.docunest-category__article:last-child {
  border-bottom: none;
}

.docunest-category__article-link {
  display: block;
  padding: 16px 0;
  text-decoration: none;
  color: inherit;
}

.docunest-category__article-link:hover {
  text-decoration: none;
}

.docunest-category__article-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--docunest-text);
  margin: 0 0 4px;
}

.docunest-category__article-link:hover .docunest-category__article-title {
  color: var(--docunest-primary);
}

.docunest-category__article-excerpt {
  font-size: 14px;
  color: var(--docunest-text-muted);
  margin: 0 0 6px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.docunest-category__article-meta {
  font-size: 12px;
  color: var(--docunest-text-muted);
}

.docunest-category__empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--docunest-text-muted);
  font-size: 15px;
}

/* ==========================================================================
   4. Single Article Layout
   ========================================================================== */

.docunest-single {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  width: 100%;
}

/* Sidebar on left (default) */
.docunest-single__sidebar {
  width: var(--docunest-sidebar-width);
  flex-shrink: 0;
  position: -webkit-sticky;
  position: sticky;
  top: 32px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--docunest-border) transparent;
  background: var(--docunest-bg);
  border: 1px solid var(--docunest-border);
  border-radius: 12px;
  padding: 0;
}

/* Account for WordPress admin bar when logged in. */
.admin-bar .docunest-single__sidebar {
  top: 64px;
  max-height: calc(100vh - 96px);
}

.docunest-single__sidebar::-webkit-scrollbar {
  width: 5px;
}

.docunest-single__sidebar::-webkit-scrollbar-track {
  background: transparent;
  margin: 12px 0;
}

.docunest-single__sidebar::-webkit-scrollbar-thumb {
  background: var(--docunest-border);
  border-radius: 10px;
}

.docunest-single__sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--docunest-text-muted);
}

/* Sidebar header with branding accent */
.docunest-sidebar-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--docunest-border);
  background: var(--docunest-bg);
  border-radius: 12px 12px 0 0;
}

.docunest-sidebar-header > * {
  flex-shrink: 0;
}

.docunest-sidebar-header > div {
  flex-shrink: 1;
  min-width: 0;
}

.docunest-sidebar-header__icon,
svg.docunest-sidebar-header__icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  color: var(--docunest-text);
  flex-shrink: 0;
}

.docunest-sidebar-header__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--docunest-text);
  line-height: 1.3;
  margin: 0 !important;
  padding: 0;
}

.docunest-sidebar-header__subtitle {
  font-size: 11px;
  color: var(--docunest-text-muted);
  line-height: 1.3;
  margin: 0 !important;
  padding: 0;
}

/* Sidebar filter / quick search */
.docunest-sidebar-filter {
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--docunest-border);
}

.docunest-sidebar-filter .docunest-sidebar-filter__input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  font-size: 13px;
  border: 1px solid var(--docunest-border);
  border-radius: 8px;
  background: var(--docunest-bg-secondary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 12px center no-repeat;
  color: var(--docunest-text);
  transition: border-color var(--docunest-transition), box-shadow var(--docunest-transition);
}

.docunest-sidebar-filter .docunest-sidebar-filter__input:focus {
  border-color: var(--docunest-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background-color: var(--docunest-bg);
}

.docunest-sidebar-filter__input::placeholder {
  color: var(--docunest-text-muted);
  font-size: 12px;
}

/* Sidebar position variants — class is on parent .docunest-single */
.docunest-single--sidebar-left > .docunest-single__sidebar {
  order: -1;
}

.docunest-single--sidebar-right > .docunest-single__sidebar {
  order: 1;
}

.docunest-single--sidebar-right > .docunest-single__content {
  order: -1;
}

.docunest-single__content {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

/* Body scroll lock when mobile sidebar is open */
body.docunest-no-scroll {
  overflow: hidden !important;
}

/* Mobile sidebar close — hidden on desktop */
.docunest-sidebar-close {
  display: none;
}

/* Mobile sidebar toggle — hidden on desktop */
.docunest-sidebar-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--docunest-text);
  background: var(--docunest-bg);
  border: 1px solid var(--docunest-border);
  border-radius: var(--docunest-radius);
  cursor: pointer;
  width: 100%;
  margin-bottom: 16px;
  transition: background var(--docunest-transition);
}

.docunest-sidebar-toggle:hover {
  background: var(--docunest-bg-secondary);
}

.docunest-sidebar-toggle__icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.docunest-sidebar-toggle__icon svg {
  width: 18px;
  height: 18px;
}

/* Sidebar overlay on mobile */
.docunest-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.docunest-sidebar-overlay--visible {
  visibility: visible;
  opacity: 1;
}

/* ==========================================================================
   5. Sidebar Navigation
   ========================================================================== */

.docunest-nav {
  padding: 10px 0 16px;
}

.docunest-nav__section {
  margin-bottom: 2px;
}

/* Section title — category heading */
.docunest-nav__section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--docunest-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--docunest-transition), background var(--docunest-transition);
  text-align: left;
  border-radius: 0;
}

.docunest-nav__section-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docunest-nav__section-title:hover {
  color: var(--docunest-text);
  background: var(--docunest-bg-secondary);
}

.docunest-nav__section-title:focus-visible {
  outline: 2px solid var(--docunest-primary);
  outline-offset: -2px;
  border-radius: 4px;
}

/* Chevron toggle */
.docunest-nav__toggle {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  color: var(--docunest-text-muted);
  opacity: 0.6;
}

.docunest-nav__section-title:hover .docunest-nav__toggle {
  opacity: 1;
}

.docunest-nav__toggle svg {
  width: 12px;
  height: 12px;
}

.docunest-nav__section--collapsed .docunest-nav__toggle {
  transform: rotate(-90deg);
}

/* Links list */
.docunest-nav__list {
  list-style: none;
  margin: 0;
  padding: 2px 8px 6px 8px;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
}

.docunest-nav__section--collapsed .docunest-nav__list {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.docunest-nav__list .docunest-nav__list {
  padding-left: 8px;
  padding-right: 0;
  border-left: 1px solid var(--docunest-border);
  margin-left: 8px;
}

.docunest-nav__item {
  margin: 0;
}

/* Individual navigation link */
.docunest-nav__link {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--docunest-text);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.15s ease,
    background 0.15s ease;
  line-height: 1.45;
  word-break: break-word;
  cursor: pointer;
}

.docunest-nav__link::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.2s ease;
}

.docunest-nav__link:hover {
  color: var(--docunest-primary);
  background: rgba(37, 99, 235, 0.06);
  text-decoration: none;
}

.docunest-nav__link:hover::before {
  background: var(--docunest-primary);
  transform: scale(1.3);
}

.docunest-nav__link:focus-visible {
  outline: 2px solid var(--docunest-primary);
  outline-offset: -1px;
}

/* Active link state */
.docunest-nav__item--active > .docunest-nav__link {
  color: var(--docunest-primary-dark);
  background: rgba(37, 99, 235, 0.08);
  font-weight: 600;
}

.docunest-nav__item--active > .docunest-nav__link::before {
  background: var(--docunest-primary);
  width: 6px;
  height: 6px;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

/* Section divider between nav sections */
.docunest-nav__section + .docunest-nav__section {
  border-top: 1px solid var(--docunest-border);
  margin-top: 6px;
  padding-top: 6px;
}

/* Article count badge */
.docunest-nav__count {
  font-size: 10px;
  font-weight: 600;
  color: var(--docunest-text-muted);
  background: var(--docunest-bg-secondary);
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ==========================================================================
   6. Breadcrumbs
   ========================================================================== */

.docunest-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  font-size: 13px;
}

.docunest-breadcrumbs__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.docunest-breadcrumbs__item::after {
  content: "/";
  color: #cbd5e1;
  margin-left: 4px;
  font-size: 11px;
}

.docunest-breadcrumbs__item:last-child::after {
  display: none;
}

.docunest-breadcrumbs__link {
  color: var(--docunest-text-muted);
  text-decoration: none;
  transition: color var(--docunest-transition);
}

.docunest-breadcrumbs__link:hover {
  color: var(--docunest-primary);
  text-decoration: underline;
}

.docunest-breadcrumbs__current {
  color: var(--docunest-text);
  font-weight: 600;
}

/* Article structure */
.docunest-article {
  margin-bottom: 40px;
}

.docunest-article__header {
  margin-bottom: 32px;
}

.docunest-article__title {
  font-size: 2em;
  font-weight: 800;
  color: var(--docunest-text);
  margin: 0 0 16px;
  line-height: 1.2;
}

.docunest-article__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--docunest-text-muted);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--docunest-border);
}

.docunest-article__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.docunest-article__meta-item .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  color: var(--docunest-text-muted);
}

/* Children articles section */
.docunest-article__children {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--docunest-border);
}

.docunest-article__children-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
}

.docunest-article__children-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.docunest-article__children-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--docunest-border);
}

.docunest-article__children-list li:last-child {
  border-bottom: none;
}

.docunest-article__children-list a {
  color: var(--docunest-text);
  font-weight: 500;
  text-decoration: none;
}

.docunest-article__children-list a:hover {
  color: var(--docunest-primary);
}

/* Related articles section */
.docunest-article__related {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--docunest-border);
}

.docunest-article__related-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
}

.docunest-article__related-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.docunest-article__related-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--docunest-border);
}

.docunest-article__related-list li:last-child {
  border-bottom: none;
}

.docunest-article__related-list a {
  color: var(--docunest-text);
  font-weight: 500;
  text-decoration: none;
}

.docunest-article__related-list a:hover {
  color: var(--docunest-primary);
}

/* Prev/Next navigation */
.docunest-article__nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--docunest-border);
}

.docunest-article__nav-prev,
.docunest-article__nav-next {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  border: 1px solid var(--docunest-border);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color var(--docunest-transition), box-shadow var(--docunest-transition);
  flex: 1;
  min-width: 0;
}

.docunest-article__nav-prev:hover,
.docunest-article__nav-next:hover {
  border-color: var(--docunest-primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
  text-decoration: none;
}

.docunest-article__nav-next {
  text-align: right;
  margin-left: auto;
}

.docunest-article__nav-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--docunest-text-muted);
}

.docunest-article__nav-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--docunest-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.docunest-article__nav-prev:hover .docunest-article__nav-title,
.docunest-article__nav-next:hover .docunest-article__nav-title {
  color: var(--docunest-primary);
}

/* Breadcrumbs list */
.docunest-breadcrumbs__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   7. Article Content Typography
   ========================================================================== */

.docunest-content {
  line-height: 1.7;
  font-size: 16px;
  color: var(--docunest-text);
  max-width: 780px;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Headings */
.docunest-content h1,
.docunest-content h2,
.docunest-content h3,
.docunest-content h4,
.docunest-content h5,
.docunest-content h6 {
  margin: 2em 0 0.75em;
  line-height: 1.3;
  font-weight: 700;
  color: var(--docunest-text);
  position: relative;
  scroll-margin-top: 80px;
}

.docunest-content h1:first-child,
.docunest-content h2:first-child,
.docunest-content h3:first-child {
  margin-top: 0;
}

.docunest-content h1 { font-size: 1.75em; }
.docunest-content h2 { font-size: 1.5em; }
.docunest-content h3 { font-size: 1.25em; }
.docunest-content h4 { font-size: 1.1em; }
.docunest-content h5 { font-size: 1em; }
.docunest-content h6 { font-size: 0.875em; color: var(--docunest-text-muted); }

/* Anchor links on headings */
.docunest-content h2 .docunest-anchor,
.docunest-content h3 .docunest-anchor,
.docunest-content h4 .docunest-anchor {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  opacity: 0;
  transition: opacity var(--docunest-transition);
  color: var(--docunest-text-muted);
  font-weight: 400;
}

.docunest-content h2:hover .docunest-anchor,
.docunest-content h3:hover .docunest-anchor,
.docunest-content h4:hover .docunest-anchor {
  opacity: 1;
}

.docunest-content h2 .docunest-anchor:hover,
.docunest-content h3 .docunest-anchor:hover,
.docunest-content h4 .docunest-anchor:hover {
  color: var(--docunest-primary);
}

/* Paragraphs */
.docunest-content p {
  margin: 0 0 1.25em;
}

/* Links */
.docunest-content a {
  color: var(--docunest-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--docunest-transition),
    border-color var(--docunest-transition);
}

.docunest-content a:hover {
  color: var(--docunest-primary-dark);
  border-bottom-color: var(--docunest-primary-dark);
  text-decoration: none;
}

/* Code - inline */
.docunest-content code {
  padding: 2px 6px;
  font-size: 0.875em;
  font-family: "SF Mono", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  background: var(--docunest-bg-secondary);
  border: 1px solid var(--docunest-border);
  border-radius: 4px;
  color: #be185d;
  word-break: break-word;
}

/* Code - blocks */
.docunest-content pre {
  position: relative;
  margin: 0 0 1.5em;
  padding: 20px 24px;
  background: #0f172a;
  border-radius: var(--docunest-radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  line-height: 1.6;
}

.docunest-content pre code {
  display: block;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  color: #e2e8f0;
  font-size: 13px;
  white-space: pre;
  word-break: normal;
}

/* Tables */
.docunest-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5em;
  font-size: 14px;
}

.docunest-content thead th {
  background: var(--docunest-bg-secondary);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid var(--docunest-border);
  color: var(--docunest-text);
  white-space: nowrap;
}

.docunest-content tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--docunest-border);
  vertical-align: top;
}

.docunest-content tbody tr:nth-child(even) {
  background: var(--docunest-bg-secondary);
}

.docunest-content tbody tr:hover {
  background: var(--docunest-primary-light);
}

/* Responsive table wrapper */
.docunest-content .docunest-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1.5em;
}

.docunest-content .docunest-table-wrap table {
  margin-bottom: 0;
}

/* Images */
.docunest-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--docunest-radius);
  box-shadow: var(--docunest-shadow);
  display: block;
  margin: 1.5em auto;
}

.docunest-content figure {
  margin: 1.5em 0;
}

.docunest-content figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--docunest-text-muted);
  margin-top: 8px;
  font-style: italic;
}

/* Blockquotes */
.docunest-content blockquote {
  margin: 0 0 1.5em;
  padding: 16px 20px;
  border-left: 4px solid var(--docunest-primary);
  background: var(--docunest-bg-secondary);
  border-radius: 0 var(--docunest-radius) var(--docunest-radius) 0;
  font-style: italic;
  color: var(--docunest-text-muted);
}

.docunest-content blockquote p:last-child {
  margin-bottom: 0;
}

.docunest-content blockquote cite {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
  color: var(--docunest-text);
}

/* Lists */
.docunest-content ul,
.docunest-content ol {
  margin: 0 0 1.5em;
  padding-left: 1.75em;
}

.docunest-content li {
  margin-bottom: 0.35em;
  line-height: 1.6;
}

.docunest-content li > ul,
.docunest-content li > ol {
  margin-top: 0.35em;
  margin-bottom: 0;
}

.docunest-content ul > li {
  list-style-type: disc;
}

.docunest-content ul > li > ul > li {
  list-style-type: circle;
}

.docunest-content ol > li {
  list-style-type: decimal;
}

/* Horizontal rules */
.docunest-content hr {
  border: none;
  border-top: 2px solid var(--docunest-border);
  margin: 2em 0;
}

/* Definitions / details */
.docunest-content details {
  margin: 0 0 1.5em;
  border: 1px solid var(--docunest-border);
  border-radius: var(--docunest-radius);
  overflow: hidden;
}

.docunest-content details summary {
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  background: var(--docunest-bg-secondary);
  transition: background var(--docunest-transition);
  user-select: none;
}

.docunest-content details summary:hover {
  background: var(--docunest-primary-light);
}

.docunest-content details[open] summary {
  border-bottom: 1px solid var(--docunest-border);
}

.docunest-content details > *:not(summary) {
  padding: 0 16px;
}

/* ==========================================================================
   8. Table of Contents
   ========================================================================== */

/* TOC in content area — hidden on desktop, visible on mobile/tablet */
.docunest-toc--mobile {
  background: var(--docunest-bg-secondary);
  border: 1px solid var(--docunest-border);
  border-left: 4px solid var(--docunest-primary);
  border-radius: 0 var(--docunest-radius) var(--docunest-radius) 0;
  padding: 20px 24px;
  margin-bottom: 32px;
  display: none;
}

/* TOC in sidebar — visible on desktop, hidden on mobile/tablet */
.docunest-sidebar-toc {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--docunest-border);
}

.docunest-sidebar-toc .docunest-toc__header {
  cursor: default;
}

.docunest-sidebar-toc .docunest-toc__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--docunest-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docunest-sidebar-toc .docunest-toc__body {
  margin-top: 10px;
  overflow: visible;
  max-height: none;
  opacity: 1;
  transition: none;
}

.docunest-sidebar-toc .docunest-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docunest-sidebar-toc .docunest-toc__list li {
  margin: 0;
  padding: 0;
}

.docunest-sidebar-toc .docunest-toc__list a {
  display: block;
  padding: 5px 0 5px 10px;
  font-size: 13px;
  color: var(--docunest-text-muted);
  text-decoration: none;
  border-left: 1px solid var(--docunest-border);
  transition: color 0.15s ease;
}

.docunest-sidebar-toc .docunest-toc__list a:hover {
  color: var(--docunest-text);
}

.docunest-sidebar-toc .docunest-toc__list a.is-active,
.docunest-sidebar-toc .docunest-toc__list a.docunest-toc__link--active {
  color: var(--docunest-text);
  font-weight: 600;
  border-left: 2px solid var(--docunest-text);
}

.docunest-sidebar-toc .docunest-toc__sublist {
  list-style: none;
  margin: 0;
  padding: 0 0 0 12px;
}

.docunest-sidebar-toc .docunest-toc__sublist a {
  font-size: 12px;
}

/* Legacy .docunest-toc (for backward compat) */
.docunest-toc:not(.docunest-toc--mobile) {
  background: var(--docunest-bg-secondary);
  border: 1px solid var(--docunest-border);
  border-left: 4px solid var(--docunest-primary);
  border-radius: 0 var(--docunest-radius) var(--docunest-radius) 0;
  padding: 20px 24px;
  margin-bottom: 32px;
}

.docunest-toc__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

/* Label text inside header */
.docunest-toc__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--docunest-text);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.docunest-toc__toggle {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--docunest-text-muted);
  border-radius: 4px;
  transition: background var(--docunest-transition),
    transform 0.25s ease;
  padding: 0;
}

.docunest-toc__toggle:hover {
  background: var(--docunest-border);
}

.docunest-toc__toggle svg {
  width: 14px;
  height: 14px;
}

.docunest-toc--collapsed .docunest-toc__toggle {
  transform: rotate(-90deg);
}

.docunest-toc__body {
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
  margin-top: 14px;
}

.docunest-toc--collapsed .docunest-toc__body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.docunest-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc-item;
}

.docunest-toc__sublist {
  margin: 0;
  padding: 0 0 0 20px;
  list-style: none;
  counter-reset: toc-item;
}

.docunest-toc__item {
  counter-increment: toc-item;
}

.docunest-toc__link {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  font-size: 14px;
  color: var(--docunest-text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.15s ease,
    background 0.15s ease;
  line-height: 1.4;
}

.docunest-toc__link::before {
  content: counter(toc-item, decimal) ".";
  font-size: 12px;
  font-weight: 700;
  color: var(--docunest-text-muted);
  min-width: 20px;
  flex-shrink: 0;
}

.docunest-toc__sublist .docunest-toc__link {
  font-size: 13px;
  padding: 4px 10px;
}

.docunest-toc__sublist .docunest-toc__link::before {
  font-size: 11px;
  min-width: 16px;
  color: var(--docunest-border);
}

.docunest-toc__link:hover {
  color: var(--docunest-primary);
  background: rgba(37, 99, 235, 0.06);
  text-decoration: none;
}

.docunest-toc__link:hover::before {
  color: var(--docunest-primary);
}

/* Active state (scroll spy) */
.docunest-toc__link--active {
  color: var(--docunest-primary-dark);
  font-weight: 600;
  background: rgba(37, 99, 235, 0.08);
}

.docunest-toc__link--active::before {
  color: var(--docunest-primary);
}

/* ==========================================================================
   9. Meta Bar
   ========================================================================== */

.docunest-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding: 12px 0;
  border-bottom: 1px solid var(--docunest-border);
  font-size: 13px;
  color: var(--docunest-text-muted);
}

.docunest-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.docunest-meta__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
}

.docunest-meta__icon svg {
  width: 16px;
  height: 16px;
}

.docunest-meta__separator {
  width: 1px;
  height: 16px;
  background: var(--docunest-border);
}

/* ==========================================================================
   10. Feedback
   ========================================================================== */

/* Feedback section */
.docunest-feedback {
  text-align: center;
  padding: 32px 24px;
  margin: 48px 0 32px;
  background: var(--docunest-bg-secondary);
  border: 1px solid var(--docunest-border);
  border-radius: 12px;
}

.docunest-feedback__question {
  font-size: 16px;
  font-weight: 600;
  color: var(--docunest-text);
  margin: 0 0 16px;
}

.docunest-feedback__buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.docunest-feedback__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid;
  border-radius: 10px;
  cursor: pointer;
  background: var(--docunest-bg);
  transition: background 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
  min-height: 44px;
}

.docunest-feedback__btn:focus-visible {
  outline: 2px solid var(--docunest-primary);
  outline-offset: 2px;
}

/* Yes button */
.docunest-feedback__btn--yes {
  color: var(--docunest-success);
  border-color: var(--docunest-success);
}

.docunest-feedback__btn--yes:hover {
  background: var(--docunest-success);
  color: #fff;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.docunest-feedback__btn--yes:active {
  transform: scale(0.95);
}

/* No button */
.docunest-feedback__btn--no {
  color: var(--docunest-danger);
  border-color: var(--docunest-danger);
}

.docunest-feedback__btn--no:hover {
  background: var(--docunest-danger);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.docunest-feedback__btn--no:active {
  transform: scale(0.95);
}

/* Emoji inside buttons */
.docunest-feedback__btn > span[aria-hidden] {
  font-size: 18px;
  line-height: 1;
}

/* Vote count badge */
.docunest-feedback__count {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.7;
}

/* Thank you message (shown after JS replaces innerHTML) */
.docunest-feedback__thanks {
  font-size: 15px;
  font-weight: 600;
  color: var(--docunest-success);
  margin: 0;
  padding: 8px 0;
  animation: docunest-fade-in 0.3s ease;
}

/* Vote counts after submission */
.docunest-feedback__counts {
  font-size: 13px;
  color: var(--docunest-text-muted);
  margin: 8px 0 0;
}

.docunest-feedback__count--yes {
  color: var(--docunest-success);
  font-weight: 600;
}

.docunest-feedback__count--no {
  color: var(--docunest-danger);
  font-weight: 600;
}

@keyframes docunest-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Pulse on click */
@keyframes docunest-pulse {
  0% { box-shadow: 0 0 0 0 currentColor; }
  70% { box-shadow: 0 0 0 10px rgba(0, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

.docunest-feedback__btn--clicked {
  animation: docunest-pulse 0.4s ease;
}

/* Error/info messages */
.docunest-feedback__message {
  font-size: 14px;
  margin: 12px 0 0;
  padding: 8px 16px;
  border-radius: 8px;
  animation: docunest-fade-in 0.3s ease;
}

.docunest-feedback__message--error {
  background: rgba(239, 68, 68, 0.08);
  color: var(--docunest-danger);
}

.docunest-feedback__message--info {
  background: rgba(37, 99, 235, 0.08);
  color: var(--docunest-primary);
}

/* ==========================================================================
   11. Related Articles
   ========================================================================== */

.docunest-related {
  margin: 32px 0;
}

.docunest-related__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--docunest-text);
  margin: 0 0 16px;
}

.docunest-related__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.docunest-related__card {
  display: block;
  padding: 16px 20px;
  background: var(--docunest-bg);
  border: 1px solid var(--docunest-border);
  border-radius: var(--docunest-radius);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--docunest-transition),
    box-shadow var(--docunest-transition);
}

.docunest-related__card:hover {
  border-color: var(--docunest-primary);
  box-shadow: var(--docunest-shadow);
  text-decoration: none;
  color: inherit;
}

.docunest-related__card:focus-visible {
  outline: 2px solid var(--docunest-primary);
  outline-offset: 2px;
}

.docunest-related__card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--docunest-text);
  margin: 0 0 6px;
  line-height: 1.4;
}

.docunest-related__card-excerpt {
  font-size: 13px;
  color: var(--docunest-text-muted);
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.docunest-related__card-category {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  background: var(--docunest-primary-light);
  color: var(--docunest-primary);
  border-radius: 10px;
}

/* ==========================================================================
   12. Prev/Next Navigation
   ========================================================================== */

.docunest-pagination {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 40px 0 24px;
}

.docunest-pagination__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  padding: 16px 20px;
  background: var(--docunest-bg);
  border: 1px solid var(--docunest-border);
  border-radius: var(--docunest-radius);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--docunest-transition),
    box-shadow var(--docunest-transition),
    transform var(--docunest-transition);
  max-width: 50%;
}

.docunest-pagination__link:hover {
  border-color: var(--docunest-primary);
  box-shadow: var(--docunest-shadow);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}

.docunest-pagination__link:focus-visible {
  outline: 2px solid var(--docunest-primary);
  outline-offset: 2px;
}

.docunest-pagination__link--next {
  text-align: right;
  margin-left: auto;
}

.docunest-pagination__label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--docunest-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.docunest-pagination__link--next .docunest-pagination__label {
  justify-content: flex-end;
}

.docunest-pagination__label svg {
  width: 14px;
  height: 14px;
}

.docunest-pagination__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--docunest-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   13. Search Results
   ========================================================================== */

.docunest-results {
  max-width: var(--docunest-max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.docunest-results__count {
  font-size: 14px;
  color: var(--docunest-text-muted);
  margin-bottom: 20px;
}

.docunest-results__count strong {
  color: var(--docunest-text);
}

.docunest-results__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.docunest-results__item {
  display: block;
  padding: 20px 24px;
  background: var(--docunest-bg);
  border: 1px solid var(--docunest-border);
  border-radius: var(--docunest-radius);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--docunest-transition),
    box-shadow var(--docunest-transition);
}

.docunest-results__item:hover {
  border-color: var(--docunest-primary);
  box-shadow: var(--docunest-shadow);
  text-decoration: none;
  color: inherit;
}

.docunest-results__item:focus-visible {
  outline: 2px solid var(--docunest-primary);
  outline-offset: 2px;
}

.docunest-results__item-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--docunest-text);
  margin: 0 0 6px;
}

.docunest-results__item-excerpt {
  font-size: 14px;
  color: var(--docunest-text-muted);
  line-height: 1.6;
  margin: 0 0 10px;
}

.docunest-results__item-excerpt mark,
.docunest-results mark {
  background: #fef08a;
  color: inherit;
  padding: 1px 3px;
  border-radius: 2px;
}

.docunest-results__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--docunest-text-muted);
}

.docunest-results__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.docunest-results__meta-category {
  padding: 2px 8px;
  background: var(--docunest-primary-light);
  color: var(--docunest-primary);
  border-radius: 10px;
  font-weight: 600;
}

/* Results Pagination */
.docunest-results__pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 32px 0 16px;
}

.docunest-results__pagination a,
.docunest-results__pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--docunest-radius);
  text-decoration: none;
  transition: background var(--docunest-transition),
    color var(--docunest-transition);
}

.docunest-results__pagination a {
  color: var(--docunest-text-muted);
  background: var(--docunest-bg);
  border: 1px solid var(--docunest-border);
}

.docunest-results__pagination a:hover {
  color: var(--docunest-primary);
  background: var(--docunest-primary-light);
  border-color: var(--docunest-primary);
  text-decoration: none;
}

.docunest-results__pagination a:focus-visible {
  outline: 2px solid var(--docunest-primary);
  outline-offset: 2px;
}

.docunest-results__pagination .current {
  color: #ffffff;
  background: var(--docunest-primary);
  border: 1px solid var(--docunest-primary);
  font-weight: 700;
}

.docunest-results__pagination .dots {
  border: none;
  color: var(--docunest-text-muted);
}

/* Empty Results */
.docunest-results__empty {
  text-align: center;
  padding: 64px 24px;
}

.docunest-results__empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--docunest-border);
}

.docunest-results__empty-icon svg {
  width: 100%;
  height: 100%;
}

.docunest-results__empty-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--docunest-text);
  margin: 0 0 8px;
}

.docunest-results__empty-text {
  font-size: 15px;
  color: var(--docunest-text-muted);
  max-width: 400px;
  margin: 0 auto;
}

/* ==========================================================================
   14. Block Styles
   ========================================================================== */

/* Card style */
.is-style-docunest-card {
  border: 1px solid var(--docunest-border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--docunest-shadow);
  background: var(--docunest-bg);
  margin-bottom: 1.5em;
}

/* Callout style */
.is-style-docunest-callout {
  border-left: 4px solid var(--docunest-primary);
  background: var(--docunest-primary-light);
  padding: 16px 20px;
  border-radius: 0 var(--docunest-radius) var(--docunest-radius) 0;
  margin-bottom: 1.5em;
}

.is-style-docunest-callout p:last-child {
  margin-bottom: 0;
}

/* Anchor headings */
.is-style-docunest-anchor h2,
.is-style-docunest-anchor h3,
.is-style-docunest-anchor h4 {
  position: relative;
  cursor: pointer;
}

.is-style-docunest-anchor h2::before,
.is-style-docunest-anchor h3::before,
.is-style-docunest-anchor h4::before {
  content: "#";
  position: absolute;
  left: -1.2em;
  color: var(--docunest-primary);
  font-weight: 400;
  opacity: 0;
  transition: opacity var(--docunest-transition);
}

.is-style-docunest-anchor h2:hover::before,
.is-style-docunest-anchor h3:hover::before,
.is-style-docunest-anchor h4:hover::before {
  opacity: 0.6;
}

/* Section dividers */
.is-style-docunest-section {
  border-bottom: 1px solid var(--docunest-border);
  padding-bottom: 24px;
  margin-bottom: 24px;
}

/* Checklist */
.is-style-docunest-checklist {
  list-style: none;
  padding-left: 0;
}

.is-style-docunest-checklist li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 8px;
}

.is-style-docunest-checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322c55e'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Step list */
.is-style-docunest-step-list {
  list-style: none;
  padding-left: 0;
  counter-reset: steps;
}

.is-style-docunest-step-list li {
  position: relative;
  padding-left: 40px;
  margin-bottom: 16px;
  min-height: 28px;
  counter-increment: steps;
}

.is-style-docunest-step-list li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  background: var(--docunest-primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Terminal block */
.is-style-docunest-terminal {
  background: #0f172a;
  color: #4ade80;
  font-family: "SF Mono", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  padding: 20px 24px;
  border-radius: var(--docunest-radius);
  overflow-x: auto;
  line-height: 1.7;
  margin-bottom: 1.5em;
  position: relative;
}

.is-style-docunest-terminal::before {
  content: "";
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='12'%3E%3Ccircle cx='6' cy='6' r='6' fill='%23ef4444'/%3E%3Ccircle cx='24' cy='6' r='6' fill='%23f59e0b'/%3E%3Ccircle cx='42' cy='6' r='6' fill='%2322c55e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 52px 12px;
}

.is-style-docunest-terminal code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* Docs table */
.is-style-docunest-docs-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  font-size: 14px;
}

.is-style-docunest-docs-table th {
  background: var(--docunest-bg-secondary);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid var(--docunest-border);
}

.is-style-docunest-docs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--docunest-border);
}

.is-style-docunest-docs-table tr:nth-child(even) td {
  background: var(--docunest-bg-secondary);
}

/* Screenshot */
.is-style-docunest-screenshot {
  border: 1px solid var(--docunest-border);
  border-radius: 12px;
  box-shadow: var(--docunest-shadow-lg);
  overflow: hidden;
  margin-bottom: 1.5em;
}

.is-style-docunest-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

/* Note blocks */
.is-style-docunest-note {
  padding: 14px 18px;
  border-radius: var(--docunest-radius);
  margin-bottom: 1.5em;
  font-size: 14px;
  line-height: 1.6;
}

.is-style-docunest-note p:last-child {
  margin-bottom: 0;
}

.is-style-docunest-note--info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.is-style-docunest-note--warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.is-style-docunest-note--success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.is-style-docunest-note--danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Generic note fallback (yellow) */
.is-style-docunest-note:not([class*="--"]) {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

/* ==========================================================================
   15. Loading Spinner
   ========================================================================== */

.docunest-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.docunest-loading__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--docunest-border);
  border-top-color: var(--docunest-primary);
  border-radius: 50%;
  animation: docunest-spin 0.7s linear infinite;
}

@keyframes docunest-spin {
  to {
    transform: rotate(360deg);
  }
}

.docunest-loading__text {
  margin-left: 12px;
  font-size: 14px;
  color: var(--docunest-text-muted);
}

/* scroll-behavior is set on .docunest-wrapper in section 1. */

/* ==========================================================================
   17. Responsive - Tablet (768px - 1024px)
   ========================================================================== */

@media screen and (max-width: 1024px) {
  :root {
    --docunest-sidebar-width: 250px;
  }

  /* Show mobile TOC in content, hide sidebar TOC */
  .docunest-toc--mobile {
    display: block;
  }

  .docunest-sidebar-toc {
    display: none;
  }

  .docunest-archive__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .docunest-single {
    gap: 28px;
  }

  /* Sidebar becomes overlay */
  .docunest-sidebar-toggle {
    display: flex;
  }

  .docunest-single__sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 85vw);
    max-height: 100vh;
    background: var(--docunest-bg);
    border: none;
    border-right: 1px solid var(--docunest-border);
    border-radius: 0;
    box-shadow: var(--docunest-shadow-lg);
    z-index: 1000;
    padding: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

  .docunest-sidebar-header {
    border-radius: 0;
  }

  .docunest-single--sidebar-right > .docunest-single__sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--docunest-border);
    transform: translateX(100%);
  }

  .docunest-single__sidebar--open {
    transform: translateX(0);
  }

  .docunest-single__content {
    width: 100%;
  }

  .docunest-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--docunest-bg-secondary);
    border: 1px solid var(--docunest-border);
    border-radius: 8px;
    cursor: pointer;
    position: sticky;
    top: 14px;
    margin-left: auto;
    margin-right: 14px;
    margin-top: 14px;
    z-index: 2;
    font-size: 16px;
    color: var(--docunest-text-muted);
    transition: background var(--docunest-transition);
    padding: 0;
  }

  .docunest-sidebar-close:hover {
    background: var(--docunest-border);
  }

  .docunest-related__grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   18. Responsive - Mobile (< 768px)
   ========================================================================== */

@media screen and (max-width: 767px) {
  .docunest-container {
    padding: 32px 16px;
  }

  .docunest-archive__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .docunest-archive__card {
    padding: 20px;
  }

  .docunest-archive__header {
    text-align: left;
    margin-bottom: 24px;
  }

  .docunest-archive__title {
    font-size: 22px;
    letter-spacing: -0.01em;
  }

  .docunest-archive__desc {
    font-size: 14px;
    margin: 0;
  }

  .docunest-single {
    flex-direction: column;
  }

  .docunest-single__sidebar {
    width: 300px;
    padding: 16px;
  }

  .docunest-content {
    font-size: 15px;
  }

  .docunest-content h1 { font-size: 1.6em; }
  .docunest-content h2 { font-size: 1.3em; }
  .docunest-content h3 { font-size: 1.15em; }

  .docunest-content pre {
    padding: 14px 16px;
    border-radius: 6px;
    font-size: 12px;
  }

  .docunest-meta {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .docunest-meta__separator {
    display: none;
  }

  .docunest-feedback__buttons {
    flex-direction: row;
  }

  .docunest-feedback__btn {
    flex: 1;
    justify-content: center;
  }

  .docunest-related__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .docunest-pagination {
    flex-direction: column;
    gap: 12px;
  }

  .docunest-pagination__link {
    max-width: 100%;
  }

  .docunest-pagination__link--next {
    text-align: left;
  }

  .docunest-pagination__link--next .docunest-pagination__label {
    justify-content: flex-start;
  }

  .docunest-results__item {
    padding: 16px 18px;
  }

  .docunest-results__item-title {
    font-size: 16px;
  }

  .docunest-results__pagination a,
  .docunest-results__pagination span {
    min-width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .docunest-toc {
    padding: 16px 18px;
  }

  .docunest-breadcrumbs {
    font-size: 12px;
  }
}

/* ==========================================================================
   19. Responsive - Small Mobile (< 480px)
   ========================================================================== */

@media screen and (max-width: 479px) {

  .docunest-archive__card {
    padding: 16px;
  }

  .docunest-archive__card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    margin-bottom: 12px;
  }

  .docunest-archive__card-title {
    font-size: 16px;
  }

  .docunest-archive__card-desc {
    font-size: 13px;
  }

  .docunest-archive__header {
    margin-bottom: 20px;
  }

  .docunest-archive__title {
    font-size: 20px;
  }

  .docunest-archive__desc {
    font-size: 13px;
    line-height: 1.5;
  }


  .docunest-content {
    font-size: 14px;
    line-height: 1.65;
  }

  .docunest-content h1 { font-size: 1.4em; }
  .docunest-content h2 { font-size: 1.2em; }

  .docunest-content pre {
    padding: 12px 14px;
    font-size: 11px;
    border-radius: 0;
  }

  .docunest-content table {
    font-size: 12px;
  }

  .docunest-content thead th,
  .docunest-content tbody td {
    padding: 8px 10px;
  }

  .docunest-feedback {
    padding: 24px 16px;
    margin: 32px 0 24px;
  }

  .docunest-results {
    padding: 0 12px;
  }

  .docunest-results__item {
    padding: 14px 16px;
  }

  .docunest-results__pagination a,
  .docunest-results__pagination span {
    min-width: 44px;
    min-height: 44px;
    padding: 0 8px;
    font-size: 12px;
  }

  .docunest-back-to-top {
    bottom: 16px;
    right: 16px;
  }

  .docunest-feedback__buttons {
    flex-direction: column;
    gap: 8px;
  }

  .docunest-feedback__btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   20. Print Styles
   ========================================================================== */

@media print {
  .docunest-nav,
  .docunest-single__sidebar,
  .docunest-sidebar-toggle,
  .docunest-sidebar-overlay,
  .docunest-feedback,
  .docunest-pagination,
  .docunest-related,
  .docunest-breadcrumbs,
  .docunest-sidebar-close {
    display: none !important;
  }

  .docunest-single {
    display: block;
  }

  .docunest-content {
    max-width: 100%;
    font-size: 12pt;
    color: #000;
  }

  .docunest-content a {
    color: #000;
    text-decoration: underline;
  }

  .docunest-content a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }

  .docunest-content a[href^="#"]::after,
  .docunest-content a[href^="javascript"]::after {
    content: "";
  }

  .docunest-content img {
    box-shadow: none;
    max-width: 100%;
    page-break-inside: avoid;
  }

  .docunest-content pre {
    background: #f5f5f5;
    border: 1px solid #ccc;
    color: #000;
    white-space: pre-wrap;
    word-wrap: break-word;
    page-break-inside: avoid;
  }

  .docunest-content pre code {
    color: #000;
  }

  .docunest-content blockquote {
    border-left-color: #999;
    background: none;
  }

  .docunest-content table {
    page-break-inside: avoid;
  }

  .docunest-content h1,
  .docunest-content h2,
  .docunest-content h3 {
    page-break-after: avoid;
  }

  /* Expand TOC for print */
  .docunest-toc {
    border: 1px solid #ccc;
    background: #f9f9f9;
    page-break-inside: avoid;
  }

  .docunest-toc--collapsed .docunest-toc__body {
    max-height: none;
    opacity: 1;
    margin-top: 14px;
  }

  .docunest-toc__toggle {
    display: none;
  }

  .docunest-meta {
    border-bottom-color: #ccc;
    color: #555;
  }

  .is-style-docunest-terminal {
    background: #f5f5f5;
    color: #000;
    border: 1px solid #ccc;
  }

  .is-style-docunest-terminal::before {
    display: none;
  }
}

/* ==========================================================================
   21. Accessibility
   ========================================================================== */

/* Focus visible outlines for keyboard navigation */
.docunest-wrapper a:focus-visible,
.docunest-wrapper button:focus-visible,
.docunest-wrapper [tabindex]:focus-visible {
  outline: 2px solid var(--docunest-primary);
  outline-offset: 2px;
}

/* Skip link */
.docunest-skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  padding: 8px 16px;
  background: var(--docunest-primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--docunest-radius);
  z-index: 10000;
  text-decoration: none;
  transition: top 0.15s ease;
}

.docunest-skip-link:focus {
  top: 8px;
  outline: 2px solid var(--docunest-primary-dark);
  outline-offset: 2px;
}

/* Minimum touch targets on mobile */
@media (pointer: coarse) {
  .docunest-nav__link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .docunest-nav__section-title {
    min-height: 44px;
  }

  .docunest-toc__link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .docunest-toc__toggle {
    min-width: 44px;
    min-height: 44px;
  }

  .docunest-breadcrumbs__link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .docunest-feedback__btn {
    min-height: 48px;
    padding: 12px 24px;
  }

  .docunest-results__pagination a,
  .docunest-results__pagination span {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ==========================================================================
   22. High Contrast / Forced Colors
   ========================================================================== */

@media (forced-colors: active) {
  .docunest-archive__card,
  .docunest-results__item,
  .docunest-related__card,
  .docunest-pagination__link {
    border: 2px solid ButtonText;
  }

  .docunest-archive__card:hover,
  .docunest-results__item:hover,
  .docunest-related__card:hover,
  .docunest-pagination__link:hover {
    border-color: Highlight;
  }

  .docunest-nav__item--active > .docunest-nav__link {
    border-left-color: Highlight;
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }

  .docunest-toc__link--active {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }

  .docunest-feedback__btn {
    border: 2px solid ButtonText;
  }

  .docunest-feedback__btn:hover {
    background: Highlight;
    color: HighlightText;
  }

  .docunest-results__pagination .current {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }

  .docunest-wrapper mark,
  .docunest-results mark {
    forced-color-adjust: none;
    background: Mark;
    color: MarkText;
  }
}

/* ==========================================================================
   23. Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .docunest-wrapper *,
  .docunest-wrapper *::before,
  .docunest-wrapper *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .docunest-archive__card:hover {
    transform: none;
  }

  .docunest-pagination__link:hover {
    transform: none;
  }

  .docunest-nav__list {
    transition: none;
  }

  .docunest-toc__body {
    transition: none;
  }
}

/* ==========================================================================
   24. Dark Mode Support (optional, theme-controlled)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  .docunest-wrapper[data-theme="auto"],
  .docunest-wrap[data-theme="auto"] {
    --docunest-primary: #60a5fa;
    --docunest-primary-light: rgba(96, 165, 250, 0.12);
    --docunest-primary-dark: #93bbfd;
    --docunest-text: #e2e8f0;
    --docunest-text-muted: #94a3b8;
    --docunest-bg: #0f172a;
    --docunest-bg-secondary: #1e293b;
    --docunest-border: #334155;
    --docunest-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --docunest-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.3);
  }

  .docunest-wrapper[data-theme="auto"] .docunest-content code,
  .docunest-wrap[data-theme="auto"] .docunest-content code {
    background: var(--docunest-bg-secondary);
    border-color: var(--docunest-border);
    color: #f472b6;
  }

  .docunest-wrapper[data-theme="auto"] .docunest-results mark,
  .docunest-wrapper[data-theme="auto"] mark,
  .docunest-wrap[data-theme="auto"] .docunest-results mark,
  .docunest-wrap[data-theme="auto"] mark {
    background: #854d0e;
    color: #fef08a;
  }
}

/* ==========================================================================
   JS-Created Dynamic Elements
   ========================================================================== */

/* Lightbox */
.docunest-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.docunest-lightbox.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.docunest-lightbox__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.docunest-lightbox__img {
  position: relative;
  max-width: 92vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.docunest-lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s ease;
}

.docunest-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Reading progress bar */
.docunest-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--docunest-primary);
  z-index: 100000;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* Back to top button */
.docunest-back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--docunest-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--docunest-shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease;
  z-index: 999;
}

.docunest-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.docunest-back-to-top:hover {
  background: var(--docunest-primary-dark);
}

/* Code copy button */
.docunest-code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--docunest-transition);
  z-index: 1;
}

.docunest-code-copy:hover {
  color: var(--docunest-primary);
  border-color: var(--docunest-primary);
  background: var(--docunest-primary-light);
}

/* Heading anchor link */
.docunest-heading-anchor {
  color: var(--docunest-text-muted);
  text-decoration: none;
  margin-left: 8px;
  opacity: 0;
  transition: opacity var(--docunest-transition);
  font-size: 0.8em;
}

.docunest-content h2:hover .docunest-heading-anchor,
.docunest-content h3:hover .docunest-heading-anchor,
.docunest-content h4:hover .docunest-heading-anchor,
.docunest-content h5:hover .docunest-heading-anchor,
.docunest-content h6:hover .docunest-heading-anchor,
.docunest-heading-anchor:focus {
  opacity: 1;
}

/* Copied tooltip */
.docunest-copied-tooltip {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--docunest-text);
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  animation: docunest-tooltip-fade 1.5s ease forwards;
}

@keyframes docunest-tooltip-fade {
  0%, 60% { opacity: 1; }
  100% { opacity: 0; }
}

