.rs-topic-nav-shell {
  border-bottom: 1px solid var(--line, #41494d);
  background: #1a1e20;
}

.rs-topic-nav {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 8px 0;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 5px;
}

.rs-topic-nav__link {
  min-width: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid #363d40;
  background: #222729;
  color: #cbd0d2;
  text-decoration: none;
  font: 10px/1.2 monospace;
  overflow-wrap: anywhere;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.rs-topic-nav__link:hover,
.rs-topic-nav__link:focus-visible {
  border-color: #727b7f;
  background: #292e31;
  color: #f2f1ed;
  outline: none;
}

.rs-topic-nav__link.is-current {
  border-color: var(--accent, #ff8518);
  color: var(--accent, #ff8518);
}

.rs-topic-nav__link--archive {
  border-color: #596267;
  color: #f2f1ed;
}

.rs-topic-nav__link.is-current:focus-visible {
  background: #292e31;
}

@media (max-width: 1100px) {
  .rs-topic-nav { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .rs-topic-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .rs-topic-nav {
    width: calc(100% - 20px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }
  .rs-topic-nav__link { min-height: 40px; }
}
