/* Справочник приёмного отделения (Библиотека → Справочник ПО) */

.rg-top { margin-bottom: 12px; }
.rg-search { display: flex; gap: 8px; }
.rg-search input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
.rg-search input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.rg-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.rg-nav {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
}
.rg-nav-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.25;
}
.rg-nav-item:hover:not(.is-active) { background: var(--accent-soft); filter: none; }
.rg-nav-item.is-active { background: var(--accent); color: #fff; }
.rg-nav-short { font-size: 0.72rem; font-weight: 500; opacity: 0.8; }
.rg-nav-ver { margin: 6px 4px 0; font-size: 0.7rem; color: var(--muted); }

.rg-content { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rg-section-head h2 { margin: 0 0 4px; font-size: 1.3rem; }
.rg-section-head p { margin: 0; color: var(--muted); }
.rg-toc { display: flex; flex-wrap: wrap; gap: 6px; }
.rg-toc-item {
  font-size: 0.8rem;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}
.rg-toc-item:hover { background: var(--accent-soft); border-color: var(--accent); }

.rg-card { padding: 16px 18px; }
.rg-card-head { margin-bottom: 8px; }
.rg-card-head h3 { margin: 0; font-size: 1.05rem; }
.rg-crumb {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 4px;
}
.rg-p { margin: 8px 0; line-height: 1.5; font-size: 0.93rem; }
.rg-h { margin: 14px 0 6px; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.03em; color: #344054; }
.rg-list { margin: 6px 0 10px; padding-left: 22px; line-height: 1.5; font-size: 0.93rem; }
.rg-list li { margin: 3px 0; }

.rg-table-wrap { overflow-x: auto; margin: 8px 0 10px; }
.rg-table td, .rg-table th { vertical-align: top; }
.rg-table.rg-table-compact td,
.rg-table.rg-table-compact th { padding: 2px 10px; line-height: 1.25; }
.rg-table.rg-table-compact thead th { padding-top: 4px; padding-bottom: 4px; }
.rg-table a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.rg-table a:hover { filter: brightness(0.85); }
.rg-table-small { font-size: 0.8rem; }
.rg-table-small th, .rg-table-small td { padding: 6px 8px; }
.rg-table-note { margin: 6px 0 0; font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.rg-table tr.rg-warn td { background: var(--warn-soft); }
.rg-muted { color: var(--muted); font-size: 0.85em; }

.rg-img { margin: 10px 0; text-align: center; }
.rg-img img {
  max-width: 100%;
  max-height: 340px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: zoom-in;
  background: #fff;
}
.rg-img.is-zoom img { max-height: none; cursor: zoom-out; }
.rg-img figcaption { margin-top: 4px; font-size: 0.78rem; color: var(--muted); }

.rg-copy {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: #fafbfc;
  padding: 8px 12px;
  margin: 8px 0;
  cursor: pointer;
}
.rg-copy:hover { background: var(--accent-soft); }
.rg-copy-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); margin-bottom: 4px; }
.rg-copy pre { margin: 0; white-space: pre-wrap; font-family: var(--mono); font-size: 0.83rem; line-height: 1.45; color: var(--ink); }

.rg-links { margin: 6px 0 10px; padding-left: 18px; font-size: 0.9rem; line-height: 1.55; }
.rg-link-note { color: var(--muted); font-size: 0.85em; }

.rg-note { border-radius: 8px; padding: 10px 12px; margin: 8px 0; font-size: 0.9rem; line-height: 1.5; border: 1px solid; }
.rg-note-info { background: var(--accent-soft); border-color: #b7e0cd; }
.rg-note-warn { background: var(--warn-soft); border-color: #fed7aa; }
.rg-note-ok { background: var(--ok-soft); border-color: #abefc6; }

.rg-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.rg-tag { font-size: 0.7rem; color: var(--muted); background: #f1f4f7; border-radius: 999px; padding: 2px 8px; }

/* виджеты */
.rg-widget {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px 12px;
  margin: 10px 0;
  background: #fff;
}
.rg-tog {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 10px;
}
.rg-tog button {
  margin: 0; border: none; border-radius: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 0.8rem; font-weight: 600; padding: 6px 14px; line-height: 1.2; white-space: nowrap;
}
.rg-tog button + button { border-left: 1px solid var(--line); }
.rg-tog button.is-active { background: var(--accent); color: #fff; }
.rg-tog button:hover:not(.is-active) { background: var(--accent-soft); color: var(--ink); filter: none; }
.rg-pane[hidden] { display: none !important; }

.rg-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; align-items: end; margin-bottom: 10px; }
.rg-form-col { grid-template-columns: 1fr; }
.rg-form .small { align-self: end; justify-self: start; }
.rg-field { display: grid; gap: 4px; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.rg-field[hidden] { display: none; }
.rg-field select, .rg-field input {
  width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font: inherit; font-weight: 500;
  background: #fff; color: var(--ink); box-sizing: border-box;
}
.rg-check { display: flex; gap: 8px; align-items: flex-start; font-size: 0.88rem; line-height: 1.35; padding: 3px 0; cursor: pointer; }
.rg-check[hidden] { display: none; }
.rg-check input { margin-top: 3px; flex-shrink: 0; }
.rg-check-group { margin-bottom: 8px; }
.rg-check-group .rg-h { margin-top: 8px; display: flex; justify-content: space-between; gap: 8px; }
.rg-count { font-weight: 600; color: var(--muted); text-transform: none; letter-spacing: 0; }
.rg-count.is-done { color: var(--ok); }

.rg-result { border-top: 1px dashed var(--line); padding-top: 10px; }
.rg-res-title { font-weight: 700; margin-bottom: 6px; }
.rg-res-row { display: grid; grid-template-columns: 200px 1fr; gap: 10px; padding: 5px 0; border-bottom: 1px solid #f0f3f6; font-size: 0.9rem; }
.rg-res-row:last-of-type { border-bottom: none; }
.rg-res-row span { color: var(--muted); }
.rg-res-block { margin-bottom: 6px; font-size: 0.9rem; }
.rg-res-block > span { color: var(--muted); }
.rg-res-block ul { margin: 4px 0 6px; padding-left: 20px; }
.rg-res-big { font-size: 1.15rem; font-weight: 700; color: var(--accent); margin: 4px 0 8px; }
.rg-res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; margin: 6px 0; }
.rg-res-grid > div { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; display: grid; gap: 2px; font-size: 0.82rem; }
.rg-res-grid > div span { color: var(--muted); font-size: 0.72rem; }
.rg-res-grid > div.is-active { border-color: var(--accent); background: var(--accent-soft); }
.rg-res-notes { margin: 6px 0; padding-left: 20px; font-size: 0.85rem; color: var(--warn); }
.rg-res-foot { margin: 8px 0 0; font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.rg-foot-notes { font-size: 0.75rem; color: var(--muted); line-height: 1.45; margin-top: 8px; }
.rg-foot-notes div { margin: 2px 0; }

@media (max-width: 860px) {
  .rg-layout { grid-template-columns: 1fr; }
  .rg-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .rg-nav-item { flex: 1 1 140px; }
  .rg-nav-short { display: none; }
  .rg-nav-ver { display: none; }
  .rg-res-row { grid-template-columns: 1fr; gap: 2px; }
}
