.td-single-doc {
  --tdsd-accent: #d60302;
  --tdsd-bg: #f7f7f5;
  --tdsd-card: #ffffff;
  --tdsd-border: #e7e7e5;
  --tdsd-text: #1f2937;
  --tdsd-muted: #6b7280;
  --tdsd-radius-lg: 22px;
  --tdsd-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  --tdsd-top-offset: 0px;
  --tdsd-scroll-offset: 90px;
  --tdsd-nav-max-height: none;
  color: var(--tdsd-text);
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.td-single-doc,
.td-single-doc * {
  box-sizing: border-box;
}

.td-single-doc a {
  text-decoration: none;
}

.td-single-doc-error {
  padding: 14px 16px;
  border: 1px solid #f1b9b9;
  background: #fff5f5;
  color: #8c2f2f;
  border-radius: 12px;
}

.tdsd-mobile-nav {
  display: none;
  position: relative;
  top: auto;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  margin: 0 0 16px;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  border-bottom: 0;
}

.tdsd-mobile-nav-inner {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 0 2px;
}

.tdsd-mobile-nav-inner::-webkit-scrollbar {
  display: none;
}

.tdsd-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  min-width: 0;
}

.tdsd-sidebar {
  position: relative;
  min-width: 0;
  align-self: start;
}

.tdsd-sidebar-sticky {
  position: relative;
  top: auto;
  padding: 18px;
  background: var(--tdsd-card);
  border: 1px solid var(--tdsd-border);
  border-radius: var(--tdsd-radius-lg);
  box-shadow: var(--tdsd-shadow);
  z-index: 1;
}

.tdsd-sidebar-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
}

.tdsd-nav {
  display: block;
  overflow: visible;
  max-height: none;
  padding-right: 0;
  scrollbar-width: auto;
  overscroll-behavior: auto;
}

.tdsd-nav::-webkit-scrollbar {
  width: 8px;
}

.tdsd-nav::-webkit-scrollbar-track {
  background: transparent;
}

.tdsd-nav::-webkit-scrollbar-thumb {
  background: rgba(31, 41, 55, 0.16);
  border-radius: 999px;
}

.tdsd-nav-link {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0 0 8px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--tdsd-text);
  background: #fff;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tdsd-nav-link:last-child {
  margin-bottom: 0;
}

.tdsd-nav-link:hover {
  background: #fafafa;
  border-color: var(--tdsd-border);
}

.tdsd-nav-link.is-active {
  background: var(--tdsd-accent);
  color: #fff;
  border-color: var(--tdsd-accent);
  box-shadow: 0 8px 18px rgba(214, 3, 2, 0.18);
}

.tdsd-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.tdsd-section {
  scroll-margin-top: var(--tdsd-scroll-offset);
  min-width: 0;
}

.tdsd-section-inner {
  background: var(--tdsd-card);
  border: 1px solid var(--tdsd-border);
  border-radius: 26px;
  box-shadow: var(--tdsd-shadow);
  padding: 28px;
  min-width: 0;
  max-width: 100%;
}

.tdsd-section-title {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--tdsd-text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tdsd-section-body {
  color: var(--tdsd-text);
  font-size: 15px;
  line-height: 1.85;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tdsd-section-body > *:first-child { margin-top: 0; }
.tdsd-section-body > *:last-child { margin-bottom: 0; }

.tdsd-section-body img,
.tdsd-section-body iframe,
.tdsd-section-body table,
.tdsd-section-body video {
  max-width: 100%;
}

.tdsd-section-body img {
  height: auto;
  border-radius: 16px;
}

@media (max-width: 1024px) {
  .tdsd-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .tdsd-sidebar {
    display: none;
  }

  .tdsd-mobile-nav {
    display: block;
  }

  .tdsd-mobile-nav .tdsd-nav-link {
    display: inline-flex;
    align-items: center;
    width: auto;
    min-width: max-content;
    margin: 0;
    border-color: var(--tdsd-border);
    padding: 10px 14px;
    min-height: 40px;
    font-size: 13px;
    white-space: nowrap;
  }
}

@media (max-width: 767px) {
  .tdsd-section-inner {
    padding: 20px;
    border-radius: 22px;
  }

  .tdsd-section-title {
    font-size: 22px;
  }

  .td-single-doc {
    --tdsd-shadow: 0 6px 18px rgba(15, 23, 42, 0.045);
  }
}
