/* Справка — 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 var(--pub-border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  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: var(--combo-hover);
  color: var(--text);
}

.help-page .help-tab-btn.active {
  background: var(--pub-accent);
  border-color: var(--pub-accent);
  color: #fff;
}

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

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

.help-page .is-hidden {
  display: none !important;
}

.help-info-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--pub-border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.45;
}

.help-info-banner svg {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  color: var(--muted);
}

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

.help-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.15rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--pub-heading);
}

.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 var(--pub-border);
}

.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 var(--pub-border);
  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: var(--bg);
}

.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: var(--text);
}

.help-section-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 4px;
  background: #f0f7ef;
  color: var(--pub-accent);
  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: var(--surface);
  border: 1px solid var(--pub-border);
  color: #6b7280;
}

.help-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--pub-accent);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.help-action-link:hover {
  color: var(--pub-heading);
  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-block {
  margin-top: 1.5rem;
  padding-top: 1.35rem;
  border-top: 2px solid var(--pub-border);
}

.help-faq-heading {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--pub-accent);
}

.help-faq-lead {
  margin: 0 0 0.85rem;
  color: #6b7280;
  font-size: 0.9375rem;
}

.help-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.help-faq-item {
  margin: 0;
  border: 1px solid var(--pub-border);
  border-radius: 10px;
  background: var(--bg);
}

.help-faq-item summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.1rem;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

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

.help-faq-item summary::after {
  content: "";
  margin-left: auto;
  flex-shrink: 0;
  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-item[open] {
  background: var(--surface);
}

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

.help-faq-item p {
  margin: 0;
  padding: 0 1.1rem 0.95rem;
  max-width: 72ch;
  color: #374151;
  font-size: 0.98rem;
  line-height: 1.65;
}

/* Феноинфо / Геоинфо */
.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 var(--pub-border);
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--surface);
}

.help-page .help-card .ui-input:focus {
  outline: none;
  border-color: var(--pub-accent);
  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: var(--pub-heading);
  font-weight: 600;
  border-bottom: 1px solid var(--pub-border);
  background: var(--bg);
  cursor: pointer;
  user-select: none;
}

.help-page .help-card .ui-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--pub-border);
  color: var(--text);
  vertical-align: middle;
}

.help-page .help-card .ui-table tbody tr:hover td {
  background: var(--bg);
}

.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 var(--pub-border);
}

.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 var(--pub-border);
  border-radius: 8px;
  background: var(--surface);
}

.legacy-ref-fs--root {
  border-color: #d4e4d0;
  background: var(--bg);
}

.legacy-ref-fs--open {
  border-color: #c8e6c9;
  background: var(--bg);
}

.legacy-ref-legend {
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  font-size: 0.9375rem;
  color: var(--pub-accent);
  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: var(--pub-accent);
}

.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 var(--pub-border);
  background: var(--surface);
  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 var(--pub-border);
  border-radius: 10px;
  background: var(--bg);
  overflow: auto;
  max-height: min(72vh, 640px);
}

.ref-split__detail {
  border: 1px solid var(--pub-border);
  border-radius: 10px;
  background: var(--surface);
  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 var(--pub-border);
  background: var(--combo-hover);
}

.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: center;
  gap: 0.35rem;
  border-radius: 6px;
}

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

.ref-tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 1.6rem;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.ref-tree-toggle--expanded {
  transform: rotate(90deg);
}

.ref-tree-toggle:hover:not(:disabled) {
  background: #f7fef9;
  border-color: #86efac;
}

.ref-tree-toggle:focus-visible {
  outline: 2px solid var(--pub-accent);
  outline-offset: 1px;
}

.ref-tree-toggle:disabled {
  opacity: 0.65;
  cursor: wait;
}

.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: var(--text);
  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: var(--pub-accent);
}

.ref-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.ref-detail-card__head + .ref-detail-actions {
  margin-top: 0.5rem;
}

.ui-label--full {
  grid-column: 1 / -1;
}

.ui-label--full textarea.ui-input {
  width: 100%;
  min-height: 12rem;
  resize: vertical;
  font-family: inherit;
}

.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: var(--text);
}

.ref-detail-desc__title {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  color: var(--pub-accent);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.help-catalog {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.help-catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.help-catalog-add {
  margin-left: auto;
}

.help-catalog-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
}

.help-catalog-crumb-btn {
  border: none;
  background: none;
  padding: 0;
  color: var(--pub-accent);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.help-catalog-crumb-sep {
  color: var(--muted);
}

.help-catalog-search-label {
  display: block;
}

.help-catalog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--pub-border);
  border-radius: 8px;
  overflow: auto;
}

.help-catalog-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--pub-border);
}

.help-catalog-row:last-child {
  border-bottom: none;
}

.help-catalog-row .help-catalog-item {
  flex: 1;
  border-bottom: none;
}

.help-catalog-row-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem 0.65rem 0.25rem 0.2rem;
  background: transparent;
  border-left: none;
}

.help-catalog-edit {
  border: 1px solid transparent;
  background: var(--pub-accent-soft);
  color: var(--text);
  box-shadow: none;
}

.help-catalog-edit:hover {
  background: var(--combo-hover);
  color: var(--text);
  border-color: transparent;
}

.help-catalog-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: none;
  border-bottom: 1px solid var(--pub-border);
  background: var(--surface);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.help-catalog-item:last-child,
.help-catalog-item--static:last-child {
  border-bottom: none;
}

.help-catalog-item:hover {
  background: var(--combo-hover);
}

.help-catalog-item--static {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--pub-border);
  background: var(--surface);
}

.help-catalog-item-title {
  color: var(--text);
  font-weight: 500;
}

.help-catalog-item-meta {
  font-size: 0.8125rem;
  color: var(--muted);
}

.help-catalog-item-info {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.4;
  max-height: 12rem;
  overflow: auto;
  margin-top: 0.35rem;
}

.help-catalog-item-info p {
  margin: 0.2rem 0;
}

.help-catalog-empty {
  padding: 0.9rem;
}

.help-links-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.help-links-list a {
  font-weight: 600;
  color: var(--primary);
}

.help-links-note {
  margin: 0.2rem 0 0;
  color: #6b7280;
  font-size: 0.875rem;
}

.help-links-admin {
  margin: 0 0 1.35rem;
  padding: 0 0 1.15rem;
  border-bottom: 1px solid var(--pub-border);
}

.help-links-edit-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pub-heading);
}

.help-links-admin textarea {
  min-height: 10rem;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8125rem;
}

.help-links-form {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 0.5rem;
  margin: 0.75rem 0 0.65rem;
}

.help-links-admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.help-links-save {
  background: #2f6f3a;
  border-color: #2f6f3a;
}

.help-links-save:hover {
  background: #265c30;
}

.help-links-table-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0 0 0.7rem;
}

.help-links-table-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--pub-heading);
  letter-spacing: -0.01em;
}

.help-page .help-card .help-links-table {
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
  font-size: 0.9375rem;
}

.help-page .help-card .help-links-table th {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.45rem 0.7rem;
  color: var(--pub-heading);
}

.help-page .help-card .help-links-table td {
  padding: 0.45rem 0.7rem;
  vertical-align: middle;
  line-height: 1.4;
}

.help-links-col-title {
  width: 34%;
}

.help-links-col-url {
  width: 40%;
}

.help-links-col-note {
  width: 26%;
}

.help-links-table.is-editable .help-links-col-title {
  width: 30%;
}

.help-links-table.is-editable .help-links-col-url {
  width: 34%;
}

.help-links-table.is-editable .help-links-col-note {
  width: 20%;
}

.help-links-col-actions {
  width: 7.5rem;
}

.help-links-title-cell {
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.help-links-url-cell {
  word-break: break-all;
}

.help-links-url-cell a {
  color: var(--primary);
  font-weight: 600;
}

.help-links-note-cell {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.help-links-acts {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
}

.help-page .help-links-acts .btn {
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  min-height: 0;
  line-height: 1.2;
  width: auto;
}

.help-page .help-links-table td.help-links-actions {
  width: 7.25rem;
  white-space: nowrap;
}

.help-links-table:not(.is-editable) .help-links-actions,
.help-links-table:not(.is-editable) .help-links-col-actions {
  display: none;
}

.help-page #useful-links-section,
.help-page .ui-table-frame,
.help-page .ui-table-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.help-page .ui-table-scroll {
  overflow-x: hidden;
}

.help-page .ui-table-pager.is-single-page .btn {
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 800px) {
  .help-links-form {
    grid-template-columns: 1fr;
  }
}

#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 var(--pub-border);
  }

  .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;
  }
}
