.md-main__inner,
.md-grid {
  max-width: 100% !important;
}

html[data-md-page="research-notes"] .md-typeset__table {
  min-width: 100%;
  overflow-x: auto;
}

html[data-md-page="research-notes"] .md-typeset table {
  width: 100% !important;
  table-layout: auto;
  white-space: normal;
}

html[data-md-page="research-notes"] .md-typeset table th,
html[data-md-page="research-notes"] .md-typeset table td {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  vertical-align: top;
}

html[data-md-page="research-notes"] .md-typeset table th {
  background-color: #f5f5f5;
  font-weight: 600;
}

.tool {
  position: relative;
}


.tools-table-wrapper {
  overflow-x: auto;
  position: relative;
}

.tools-table {
  width: 100%;
  border-collapse: collapse;
}

.tools-table__th,
.tools-table__td {
  border: 1px solid #e0e0e0;
  padding: 8px 10px;
  vertical-align: top;
}

.tools-table__th {
  background: #1953ff;
  color: #fff;
  font-weight: 600;
  text-align: left;
}

.tools-table__td--ps,
.tools-table__td--oss {
  min-width: 220px;
}

/* элемент‑инструмент в ячейке */
.tool {
  display: inline-block;
  margin: 2px 4px;
  position: relative;
}

.tool__name {
  background: none;
  border: none;
  padding: 0;
  color: #1953ff;
  text-align: left;
}

.tool__name:hover,
.tool__name:focus {
  text-decoration: underline;
}

.tool-popup {
  display: none;
  position: absolute;
  z-index: 50;
  top: 100%;
  left: 0;
  margin-top: 4px;
  width: 520px;
  max-width: 90vw;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #1953ff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 4px;
}

.tool-popup--visible {
  display: block;
}

.tool-popup__inner {
  padding: 8px 10px 10px;
  font-size: 14px;
  line-height: 1.4;
}

.tool-popup__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.tool-popup__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.tool-popup__close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.tools-map__header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tools-map__header h1 {
  margin: 0;
  flex: 1;
}

.tools-pdf-button {
  font-size: 0.6rem;
  padding: 0.2rem 0.7rem;
  border-radius: 0.6rem;
  margin-top: 1rem;
  display: inline-block;
}

@media (max-width: 640px) {
  .tools-map__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .tools-map__header h1 {
    width: 100%;
  }
}
