/* I-94: restrained editorial TOC, preserving the existing navigation logic. */
.toc-overlay {
  background: rgba(7, 7, 7, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.toc-panel {
  color: rgba(255, 255, 255, 0.76);
  background: #151412;
  border-color: rgba(184, 141, 115, 0.2);
}

.toc-panel::before {
  display: none;
}

.toc-panel__title {
  padding: 28px 28px 0;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 5px;
  color: #d1a88e;
  text-shadow: none;
}

.toc-panel__title::after {
  content: 'СОДЕРЖАНИЕ';
  display: block;
  width: auto;
  height: auto;
  margin: 9px 0 0;
  padding: 0 0 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: none;
  font-family: var(--font-body);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 2.6px;
  color: rgba(255, 255, 255, 0.42);
}

html[lang^="en"] .toc-panel__title::after {
  content: 'CONTENTS';
}

html[lang^="ar"] .toc-panel__title::after,
html[dir="rtl"] .toc-panel__title::after {
  content: 'المحتويات';
}

html[lang^="zh"] .toc-panel__title::after {
  content: '目录';
}

.toc-panel__close,
.toc-mode-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(184, 141, 115, 0.26);
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: #c79b80;
  opacity: 0.78;
}

.toc-panel__close:hover,
.toc-panel__close:focus-visible,
.toc-mode-toggle:hover,
.toc-mode-toggle:focus-visible,
.toc-mode-toggle.active {
  color: #f7f1ec;
  background: rgba(184, 141, 115, 0.12);
  border-color: rgba(184, 141, 115, 0.52);
  box-shadow: none;
  opacity: 1;
  outline: none;
}

.toc-panel__close:focus-visible,
.toc-mode-toggle:focus-visible {
  box-shadow: 0 0 0 3px rgba(184, 141, 115, 0.16);
}

.toc-panel__list {
  padding: 8px 0 24px;
  scrollbar-color: rgba(184, 141, 115, 0.32) transparent;
}

.toc-panel__list::-webkit-scrollbar {
  width: 3px;
}

.toc-panel__list::-webkit-scrollbar-thumb,
.toc-panel__list:hover::-webkit-scrollbar-thumb {
  background: rgba(184, 141, 115, 0.32);
  border-radius: 3px;
}

.toc-panel--cascade .toc-panel__item,
.toc-panel--cascade .toc-category-divider,
.toc-panel--cascade-visible .toc-panel__item,
.toc-panel--cascade-visible .toc-category-divider {
  opacity: 1;
  transform: none;
  animation: none;
}

.toc-panel__item {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 12px 26px;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  transform: none;
}

.toc-panel__item::before {
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 0;
  background: #c79b80;
  opacity: 0;
  transition: opacity .22s var(--ease-luxury);
}

.toc-panel__item::after {
  display: none;
}

.toc-panel__item:hover,
.toc-panel__item:active,
.toc-panel__item.active {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: none;
  transform: none;
}

.toc-panel__item:hover::before,
.toc-panel__item:active::before,
.toc-panel__item.active::before {
  top: 9px;
  bottom: 9px;
  opacity: 1;
}

.toc-panel__item-num {
  width: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #c79b80;
  font-size: 9.5px;
  line-height: 1;
  opacity: 0.58;
  text-align: left;
}

.toc-panel__item-label {
  min-width: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
}

.toc-panel__item:hover .toc-panel__item-label {
  color: rgba(255, 255, 255, 0.9);
}

.toc-panel__item:hover .toc-panel__item-num,
.toc-panel__item.active .toc-panel__item-num {
  color: #d8af94;
  background: transparent;
  border: 0;
  opacity: 1;
  transform: none;
}

.toc-panel__item.active .toc-panel__item-label {
  color: #f3ede8;
  font-weight: 500;
}

.toc-category-divider {
  padding: 20px 26px 7px;
  gap: 12px;
}

.toc-category-divider__line:first-child {
  display: none;
}

.toc-category-divider__line,
.toc-category-divider__line:first-child {
  height: 1px;
  background: rgba(184, 141, 115, 0.22);
}

.toc-category-divider__label {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 2.2px;
  color: rgba(209, 168, 142, 0.78);
  opacity: 1;
}

.toc-search {
  position: relative;
  padding: 14px 26px 10px;
}

.toc-search__input {
  height: 42px;
  padding: 0 34px 0 30px;
  border: 0;
  border-bottom: 1px solid rgba(184, 141, 115, 0.3);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
}

.toc-search::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  top: 28px;
  left: 28px;
  margin: 0;
  border: 1px solid rgba(209, 168, 142, 0.68);
  border-radius: 50%;
  pointer-events: none;
}

.toc-search::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 1px;
  top: 40px;
  left: 39px;
  margin: 0;
  transform: rotate(45deg);
  background: rgba(209, 168, 142, 0.68);
  pointer-events: none;
}

.toc-search__input::placeholder {
  color: rgba(255, 255, 255, 0.34);
}

.toc-search__input::-webkit-search-cancel-button {
  width: 30px;
  height: 30px;
  margin: 0 -4px 0 6px;
  border-radius: 4px;
  -webkit-appearance: none;
  appearance: none;
  background-color: transparent;
  background-image:
    linear-gradient(45deg, transparent 46%, #c79b80 46%, #c79b80 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, #c79b80 46%, #c79b80 54%, transparent 54%);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 11px 11px;
  cursor: pointer;
  opacity: .72;
  transition: background-color .2s var(--ease-luxury), opacity .2s var(--ease-luxury);
}

.toc-search__input::-webkit-search-cancel-button:hover {
  background-color: rgba(184, 141, 115, 0.12);
  opacity: 1;
}

.toc-search__input:focus {
  border-color: rgba(209, 168, 142, 0.76);
  box-shadow: none;
}

.toc-search__status {
  min-height: 12px;
  margin-top: 6px;
  color: rgba(209, 168, 142, 0.7);
  font-size: 8px;
  letter-spacing: 1px;
}

html[dir="rtl"] .toc-panel__item::before {
  left: auto;
  right: 0;
}

html[dir="rtl"] .toc-panel__item-num {
  direction: ltr;
  text-align: right;
}

html[dir="rtl"] .toc-panel__item-label {
  text-align: right;
}

html[dir="rtl"] .toc-search__input {
  padding: 0 30px 0 34px;
  text-align: right;
}

html[dir="rtl"] .toc-search__input::-webkit-search-cancel-button {
  margin: 0 6px 0 -4px;
}

html[dir="rtl"] .toc-search::before {
  right: 28px;
  left: auto;
}

html[dir="rtl"] .toc-search::after {
  right: 39px;
  left: auto;
  margin: 0;
  transform: rotate(-45deg);
}

@media (min-width: 1025px) {
  .toc-panel {
    width: 368px;
    background: #151412;
    border-left: 1px solid rgba(184, 141, 115, 0.2);
    box-shadow: -22px 0 64px rgba(0, 0, 0, 0.52);
  }

  .toc-panel__close {
    top: 18px;
    right: 18px;
  }

  .toc-mode-toggle {
    top: 18px;
    left: 18px;
  }
}

@media (min-width: 768px) and (max-width: 1024px),
       (max-width: 900px) and (orientation: landscape) {
  .toc-panel {
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(390px, 82vw);
    height: 100%;
    max-height: none;
    border: 0;
    border-left: 1px solid rgba(184, 141, 115, 0.2);
    border-radius: 0;
    background: #151412;
    box-shadow: -18px 0 54px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
  }

  .toc-panel.open {
    transform: translateX(0);
  }
}

@media (max-width: 767px) and (orientation: portrait) {
  .toc-panel {
    max-height: 82dvh;
    border: 0;
    border-top: 1px solid rgba(184, 141, 115, 0.24);
    border-radius: 12px 12px 0 0;
    background: #151412;
    box-shadow: 0 -20px 54px rgba(0, 0, 0, 0.5);
  }

  .toc-panel__handle {
    width: 44px;
    height: 3px;
    background: rgba(209, 168, 142, 0.52);
  }

  .toc-panel__title {
    padding: 18px 20px 0;
    font-size: 10px;
    letter-spacing: 4px;
  }

  .toc-panel__close,
  .toc-mode-toggle {
    width: 40px;
    height: 40px;
    top: 16px;
  }

  .toc-panel__close {
    right: 16px;
  }

  .toc-mode-toggle {
    left: 16px;
  }

  .toc-search {
    padding: 12px 20px 8px;
  }

  .toc-search__input {
    height: 44px;
  }

  .toc-panel__list {
    padding: 6px 0 calc(22px + env(safe-area-inset-bottom, 0px));
  }

  .toc-panel__item {
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 13px 20px;
    border-radius: 0;
  }

  .toc-category-divider {
    padding: 18px 20px 7px;
  }
}

/* Quiet handoff from a service card to contents. */
body.svc-panel-toc-handoff .toc-overlay {
  transition: opacity 260ms cubic-bezier(.22, 1, .36, 1);
}

body.svc-panel-toc-handoff .toc-panel {
  opacity: 0;
  visibility: hidden;
  transition: transform 320ms cubic-bezier(.22, 1, .36, 1), opacity 240ms cubic-bezier(.22, 1, .36, 1), visibility 320ms;
  will-change: transform, opacity;
}

body.svc-panel-toc-preparing .toc-panel {
  transition: none;
}

body.svc-panel-toc-handoff .toc-panel.open {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 768px),
       (max-width: 900px) and (orientation: landscape) {
  body.svc-panel-toc-handoff .toc-panel {
    transform: translateX(18px);
  }

  body.svc-panel-toc-handoff .toc-panel.open {
    transform: translateX(0);
  }
}

@media (max-width: 767px) and (orientation: portrait) {
  body.svc-panel-toc-handoff .toc-panel {
    transform: translateY(14px);
  }

  body.svc-panel-toc-handoff .toc-panel.open {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .toc-panel,
  .toc-panel__item,
  .toc-panel__item::before {
    transition-duration: 0.01ms;
  }
}
