/* Left sidebar — light theme */
.doc-shell {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  min-height: 100vh;
}

.doc-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  padding: 1.35rem 1rem 0;
  border-right: 1px solid var(--line, #e4e4e7);
  background: #ffffff;
}

.doc-sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding: 1rem 0.65rem 1.15rem;
  border-top: 1px solid var(--line, #e4e4e7);
}

.doc-lang-switch {
  display: flex;
  flex-shrink: 0;
  gap: 0.25rem;
}

.doc-lang-switch__btn {
  border: 1px solid var(--line, #e4e4e7);
  border-radius: 8px;
  padding: 0.3rem 0.45rem;
  min-width: 2.25rem;
  background: var(--panel-2, #fafbfc);
  color: var(--muted, #71717a);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.doc-lang-switch__btn:hover {
  color: var(--text, #18181b);
  border-color: rgba(14, 116, 144, 0.25);
}

.doc-lang-switch__btn.is-active {
  color: var(--accent, #0e7490);
  border-color: rgba(14, 116, 144, 0.35);
  background: var(--accent-dim, rgba(14, 116, 144, 0.1));
}

.doc-sidebar-brand {
  display: block;
  margin-bottom: 1.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid var(--line, #e4e4e7);
  background: var(--panel-2, #fafbfc);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.doc-sidebar-brand:hover {
  border-color: rgba(14, 116, 144, 0.25);
  background: var(--accent-dim, rgba(14, 116, 144, 0.06));
  box-shadow: 0 2px 8px rgba(24, 24, 27, 0.04);
}

.doc-sidebar-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text, #18181b);
  letter-spacing: -0.02em;
}

.doc-sidebar-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #71717a);
}

.doc-nav {
  flex: 1;
}

.doc-sidebar-updated {
  margin: 0;
  min-width: 0;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--muted, #71717a);
}

.doc-nav-label {
  margin: 0 0 0.45rem;
  padding: 0 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #71717a);
}

.doc-nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.15rem 0;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary, #3f3f46);
  transition: background 0.15s ease, color 0.15s ease;
}

.doc-nav-link-label {
  min-width: 0;
}

.doc-nav-local-badge {
  flex-shrink: 0;
  margin-left: auto;
  padding: 0.12rem 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(161, 98, 7, 0.28);
  background: rgba(251, 191, 36, 0.16);
  color: #92400e;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.doc-nav-link:hover {
  color: var(--text, #18181b);
  background: #f4f4f5;
}

.doc-nav-link.is-active {
  color: var(--accent, #0e7490);
  background: var(--accent-dim, rgba(14, 116, 144, 0.1));
  box-shadow: inset 2px 0 0 var(--accent, #0e7490);
}

.doc-nav-link.is-active .doc-nav-local-badge {
  border-color: rgba(14, 116, 144, 0.3);
  background: rgba(14, 116, 144, 0.1);
  color: var(--accent, #0e7490);
}

.doc-nav-sub {
  margin: -0.05rem 0 0.5rem 0.75rem;
  padding-left: 0.65rem;
  border-left: 1px solid var(--line, #e4e4e7);
}

.doc-nav-sub .doc-nav-link {
  font-size: 0.8rem;
  font-weight: 550;
  padding: 0.35rem 0.55rem;
}

.doc-main {
  min-width: 0;
  background: var(--bg, #f7f8fa);
}

.doc-page .hero,
.doc-page .content,
.doc-page .footer {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.doc-page .nav-links {
  display: none;
}

@media (max-width: 900px) {
  .doc-shell {
    grid-template-columns: 1fr;
    /* Keep stacked rows at the top; stretch would pad space between sidebar and main */
    align-content: start;
  }

  .doc-sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line, #e4e4e7);
    padding: 0.75rem 0.65rem 0;
  }

  .doc-sidebar-footer {
    margin-top: 0.65rem;
    /* Match .doc-nav-link horizontal padding so «обновлено» lines up with chips */
    padding: 0.65rem 0.45rem 0.85rem;
  }

  .doc-sidebar-brand {
    margin-bottom: 0.65rem;
  }

  .doc-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .doc-nav-label {
    width: 100%;
  }

  .doc-nav-sub {
    display: contents;
  }

  .doc-nav-link {
    margin: 0;
    padding: 0.35rem 0.55rem;
    font-size: 0.8rem;
  }

  .doc-nav-sub .doc-nav-link {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.55rem;
  }

  .doc-nav-link.is-active {
    box-shadow: none;
  }

  .doc-page .hero {
    padding-top: 0.85rem;
  }
}
