.mrx-toc-inline,
.mrx-toc-float-panel {
  background: var(--mrx-toc-bg, #f6f7f9);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.mrx-toc-inline {
  margin: 10px 0;
  overflow: hidden;
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  min-width: min(320px, 100%);
  color: #111;
}

.mrx-toc-inline button { margin-bottom: 0; }

.mrx-toc-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 46px;
  padding: 17px;
  font-weight: 700;
  color: #111;
  cursor: pointer;
  gap: 16px;
}

.mrx-toc-toggle-label {
  flex: 1;
  text-align: left;
  line-height: 1.2;
  text-transform: uppercase;
}

.mrx-toc-toggle-icon {
  font-size: 24px;
  line-height: 1;
  flex: 0 0 auto;
}

.mrx-toc-float-header button{min-height:0;margin-right:0;margin-bottom:0;}

.mrx-toc-list-wrap {
  padding: 0 16px 14px;
}

.mrx-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mrx-toc-item {
  margin: 4px 0;
}

.mrx-toc-item a {
  text-decoration: none;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: #111;
  font-size: 14px;
  line-height: 1.45;
}

.mrx-toc-item a:hover,
.mrx-toc-item a:focus {
  color: #111;
  text-decoration: underline;
}

.mrx-toc-item-number,
.mrx-toc-heading-number {
  font-weight: 700;
  color: #111;
  flex: 0 0 auto;
}

.mrx-toc-item-text {
  min-width: 0;
  word-break: break-word;
}

.mrx-toc-item.mrx-h3 {
  padding-left: 14px;
}

.mrx-toc-item.mrx-h4 {
  padding-left: 28px;
}

.mrx-toc-heading-anchor,
.mrx-toc-heading-text {
  color: inherit;
}

.mrx-toc-heading-text-italic {
  font-style: italic;
}

.mrx-toc-heading-number {
  margin-right: 0;
}

.mrx-toc-floating {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 99999;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.mrx-toc-floating > * {
  pointer-events: auto;
}

.mrx-toc-float-button {
  width: 46px;
  min-width: 46px;
  height: 64px;
  margin: 0;
  border: 1px solid rgba(0,0,0,0.12);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: #fff;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.mrx-toc-float-button:hover,
.mrx-toc-float-button:focus {
  background: #fff;
  color: #111;
}

.mrx-toc-float-icon,
.mrx-toc-float-icon svg {
  display: block;
}

.mrx-toc-float-icon svg {
  width: 22px;
  height: 22px;
}

.mrx-toc-float-panel {
  position: absolute;
  right: 46px;
  top: 50%;
  transform: translateY(-50%);
  width: min(320px, calc(100vw - 72px));
  height: auto;
  max-height: min(78vh, calc(100vh - 32px));
  overflow: hidden;
  color: #111;
}

.mrx-toc-float-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  font-weight: 700;
  color: #111;
}

.mrx-toc-float-title {
  flex: 1;
  min-width: 0;
  text-align: left;
  text-transform: uppercase;
  font-size: 13px;
  line-height: 1.2;
}

.mrx-toc-close {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #111;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0;
}

.mrx-toc-float-body {
  max-height: calc(min(78vh, calc(100vh - 32px)) - 42px);
  overflow: auto;
}

.mrx-toc-float-panel .mrx-toc-list {
  padding: 10px 12px 12px;
}

html {
  scroll-behavior: smooth;
}

body.admin-bar .mrx-toc-floating {
  top: calc(50% + 16px);
}

.mrx-toc-heading-marker {
  display: inline-block;
  margin-right: 6px;
  font-weight: 700;
}

.mrx-toc-heading-marker-star,
.mrx-toc-heading-marker-plus {
  color: inherit;
}

.mrx-mobile-collapsible-heading {
  position: relative;
}

.mrx-mobile-section-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  height: auto;
  padding: 0;
  margin: 0 0 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  vertical-align: baseline;
  line-height: inherit;
}

.mrx-mobile-section-toggle-icon {
  display: inline-block;
  font-size: 0.9em;
  line-height: 1;
  transition: transform 0.2s ease;
}

.mrx-mobile-section-toggle-icon {
  display: inline-block;
  transform: rotate(90deg); /* mặc định: > thành ↓ */
  transition: transform 0.25s ease;
}

.mrx-mobile-collapsible-heading.is-open .mrx-mobile-section-toggle-icon {
  transform: rotate(-90deg); /* mở: ↑ */
}

.entry-content .mrx-toc-heading-anchor::before,
.entry-content h2.mrx-toc-heading-anchor::before,
.entry-content h3.mrx-toc-heading-anchor::before,
.entry-content h4.mrx-toc-heading-anchor::before {
  content: none !important;
  display: none !important;
}

@media (max-width: 849px) {
  .mrx-mobile-collapsible-heading .mrx-mobile-section-toggle {
    display: inline-flex;
  }

  .mrx-mobile-section-content[hidden] {
    display: none !important;
  }
}


@media (max-width: 849px) {
  .mrx-mobile-collapsible-heading {
    position: relative;
    display: block;
    cursor: pointer;
    line-height: 1.4;
  }

  .mrx-mobile-collapsible-heading .mrx-mobile-section-toggle {
    display: inline-flex;
    vertical-align: middle;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    height: auto;
    padding: 0;
    margin: 0 0 0 6px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .mrx-mobile-section-toggle-icon {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s ease;
    margin-top: -2px;
  }

  .mrx-mobile-collapsible-heading.is-open .mrx-mobile-section-toggle-icon {
    transform: rotate(225deg);
    margin-top: 2px;
  }
}

  .mrx-mobile-collapsible-heading .mrx-mobile-section-toggle:focus,
  .mrx-mobile-collapsible-heading .mrx-mobile-section-toggle:hover {
    background: transparent !important;
    box-shadow: none !important;
  }

  .mrx-mobile-section-toggle-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s ease;
    margin-top: -7px;margin-left: 5px;
  }

  .mrx-mobile-collapsible-heading.is-open .mrx-mobile-section-toggle-icon {
    transform: rotate(225deg);
    margin-top: 2px;
  }
}
