/* Справка — design/work/info.html */

/* Вкладки — макет info.html */
.help-page .help-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.help-page .help-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.help-page .help-tab-btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.help-page .help-tab-btn:hover {
  background: #f3f4f6;
  color: #2e4a3e;
}

.help-page .help-tab-btn.active {
  background: #3a5a38;
  border-color: #3a5a38;
  color: #fff;
}

.help-panel {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.help-panel.is-hidden {
  display: none;
}

.help-info-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  color: #1f2937;
  font-size: 0.875rem;
  line-height: 1.45;
}

.help-info-banner svg {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  color: #6b7280;
}

.help-card {
  background: #fff;
  border-radius: var(--pub-radius-lg);
  border: 1px solid var(--pub-border);
  box-shadow: var(--pub-shadow);
  padding: 1.35rem 1.5rem;
}

.help-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.15rem;
  font-size: 1rem;
  font-weight: 600;
  color: #3a5a38;
}

.help-card-title svg {
  flex-shrink: 0;
}

/* Таблица навигации */
.help-page .help-nav-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.help-page .help-nav-table th {
  text-align: left;
  padding: 0.65rem 1rem;
  color: #6b7280;
  font-weight: 500;
  font-size: 0.8125rem;
  border-bottom: 1px solid #e5e7eb;
}

.help-page .help-nav-table th:last-child {
  text-align: right;
}

.help-page .help-nav-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
}

.help-page .help-nav-table tbody tr:last-child td {
  border-bottom: none;
}

.help-page .help-nav-table tbody tr:hover td {
  background: #fafafa;
}

.help-page .help-nav-table td:nth-child(2) {
  color: #6b7280;
}

.help-page .help-nav-table td:last-child {
  text-align: right;
  white-space: nowrap;
}

.help-section-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  color: #1f2937;
}

.help-section-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 4px;
  background: #f0f7ef;
  color: #3a5a38;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.help-section-icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.help-section-icon--muted {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #6b7280;
}

.help-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #3a5a38;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.help-action-link:hover {
  color: #1b5e20;
  text-decoration: underline;
}

.help-action-link svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s ease;
}

.help-action-link:hover svg {
  transform: translateX(3px);
}

.help-faq {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid #e5e7eb;
}

.help-faq summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 500;
  color: #1f2937;
  cursor: pointer;
  list-style: none;
}

.help-faq summary::-webkit-details-marker {
  display: none;
}

.help-faq summary::after {
  content: "";
  margin-left: auto;
  width: 1.1rem;
  height: 1.1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform 0.2s ease;
}

.help-faq[open] summary::after {
  transform: rotate(180deg);
}

.help-faq ul {
  margin: 0.85rem 0 0 3rem;
  padding: 0;
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.55;
}

.help-faq li + li {
  margin-top: 0.45rem;
}

/* Феноинфо / Геоинфо */
.help-page .help-card .ui-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
  padding: 0;
  border: none;
  background: transparent;
}

.help-page .help-card .ui-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
}

.help-page .help-card .ui-input {
  min-width: 10rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.875rem;
  background: #fff;
}

.help-page .help-card .ui-input:focus {
  outline: none;
  border-color: #3a5a38;
  box-shadow: 0 0 0 3px rgba(58, 90, 56, 0.1);
}

.help-page .help-card .ui-msg {
  min-height: 0;
  margin-bottom: 0.65rem;
  font-size: 0.8125rem;
  color: #6b7280;
}

.help-table-panel {
  margin-top: 0.25rem;
}

.help-page .help-card .ui-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.help-page .help-card .ui-table th {
  text-align: left;
  padding: 0.7rem 0.85rem;
  color: #3a5a38;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
  cursor: pointer;
  user-select: none;
}

.help-page .help-card .ui-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid #e5e7eb;
  color: #1f2937;
  vertical-align: middle;
}

.help-page .help-card .ui-table tbody tr:hover td {
  background: #f9fafb;
}

.help-page .help-card .btn-soft {
  border-radius: 8px;
  font-size: 0.8125rem;
  padding: 0.4rem 0.7rem;
}

.help-page .status-col {
  text-align: center;
}

/* Legacy-деревья Феноинфо / Геоинфо (как as_is fieldset) */
.legacy-ref-page-card {
  padding: 1.25rem 1.5rem 1.5rem;
}

.legacy-ref-page-head {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.legacy-ref-page-title {
  margin: 0;
  font-size: 1.125rem;
  color: #9e5a5c;
}

.legacy-ref-admin-link {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
}

.legacy-ref-root {
  min-height: 12rem;
}

.legacy-ref-root--loading {
  opacity: 0.65;
}

.legacy-ref-loading {
  padding: 1rem 0;
}

.legacy-ref-form {
  margin: 0;
}

.legacy-ref-fs {
  margin: 0.35rem 0;
  padding: 0.35rem 0.65rem 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.legacy-ref-fs--root {
  border-color: #d4e4d0;
  background: #f9fbf8;
}

.legacy-ref-fs--open {
  border-color: #c8e6c9;
  background: #fafdfa;
}

.legacy-ref-legend {
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  font-size: 0.9375rem;
  color: #3a5a38;
  user-select: none;
}

.legacy-ref-legend--static {
  cursor: default;
}

.legacy-ref-legend:hover {
  color: #2e4a2e;
}

.legacy-ref-body {
  margin: 0.35rem 0 0 0.5rem;
  padding-left: 0.35rem;
}

.legacy-ref-spacer {
  margin: 0.2rem 0;
  height: 0;
}

.legacy-ref-leaf {
  margin: 0.25rem 0;
}

.legacy-ref-leaf-btn {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1f4a7a;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legacy-ref-leaf-btn:hover {
  color: #9e5a5c;
}

.legacy-ref-info .popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.legacy-ref-info__body {
  font-size: 0.9375rem;
  line-height: 1.6;
  max-height: min(65vh, 520px);
  overflow: auto;
}

/* Вариант A: дерево + панель */
.ref-ref-page-card {
  padding: 1.25rem 1.5rem 1.5rem;
}

.ref-ref-page-head {
  margin-bottom: 1rem;
}

.ref-ref-page-title {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  color: #3a5a38;
}

.ref-ref-admin-link {
  margin: 0;
  font-size: 0.8125rem;
}

.ref-geo-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ref-geo-subtab {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4b5563;
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.ref-geo-subtab.is-active {
  background: #e8f5e9;
  border-color: #c8e6c9;
  color: #2e4a2e;
}

.ref-split {
  display: grid;
  grid-template-columns: minmax(240px, 34%) minmax(0, 1fr);
  gap: 1rem 1.25rem;
  align-items: stretch;
  min-height: 420px;
}

.ref-split__tree {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
  overflow: auto;
  max-height: min(72vh, 640px);
}

.ref-split__detail {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  overflow: auto;
  max-height: min(72vh, 640px);
  padding: 1rem 1.15rem;
}

.ref-tree-root-label {
  padding: 0.65rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  background: #f3f6f2;
}

.ref-tree-list,
.ref-tree-children {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0 0.5rem;
}

.ref-tree-children {
  padding-left: 1.15rem;
  border-left: 2px solid #e8f0e6;
  margin-left: 0.65rem;
}

.ref-tree-node {
  margin: 0.1rem 0;
}

.ref-tree-node--empty {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
}

.ref-tree-row {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  border-radius: 6px;
}

.ref-tree-row.is-selected {
  background: #e8f5e9;
}

.ref-tree-toggle {
  flex: 0 0 1.6rem;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: none;
  background: transparent;
  color: #3a5a38;
  font-size: 0.7rem;
  line-height: 1.6rem;
  cursor: pointer;
  border-radius: 4px;
}

.ref-tree-toggle:hover:not(:disabled) {
  background: #e8f5e9;
}

.ref-tree-toggle--spacer {
  visibility: hidden;
}

.ref-tree-label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  padding: 0.25rem 0.45rem;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #1f2937;
  cursor: pointer;
  border-radius: 4px;
}

.ref-tree-label:hover {
  color: #2e4a2e;
}

.ref-tree-msg {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
}

.ref-tree-msg.error {
  color: #b42318;
}

.ref-detail-empty {
  padding: 2rem 1rem;
  text-align: center;
  line-height: 1.6;
}

.ref-detail-loading {
  padding: 2rem 1rem;
  text-align: center;
}

.ref-detail-card__head {
  margin-bottom: 0.85rem;
}

.ref-detail-badge {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #e8f5e9;
  color: #2e5c2a;
  font-size: 0.75rem;
  font-weight: 600;
}

.ref-detail-card__title {
  margin: 0;
  font-size: 1.05rem;
  color: #3a5a38;
}

.ref-detail-meta {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.ref-detail-meta th {
  text-align: left;
  padding: 0.35rem 0.65rem 0.35rem 0;
  color: #6b7280;
  font-weight: 500;
  width: 38%;
  vertical-align: top;
}

.ref-detail-meta td {
  padding: 0.35rem 0;
  color: #1f2937;
}

.ref-detail-desc__title {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  color: #3a5a38;
}

.ref-detail-card__body,
.ref-detail-desc__body {
  font-size: 0.9375rem;
  line-height: 1.65;
}

#geo-hierarchy-panel.is-hidden,
.ref-geo-plots-panel.is-hidden {
  display: none;
}

@media (max-width: 900px) {
  .ref-split {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .ref-split__tree,
  .ref-split__detail {
    max-height: 320px;
  }
}

@media (max-width: 640px) {
  .help-page .help-nav-table thead {
    display: none;
  }

  .help-page .help-nav-table tr {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
  }

  .help-page .help-nav-table td {
    display: block;
    padding: 0.25rem 0;
    border: none;
    text-align: left !important;
  }

  .help-page .help-nav-table td:last-child {
    padding-top: 0.5rem;
  }
}
