/* ============================================
   Wikipedia-style — Association of Applied Psychologists (AAP)
   Global registry: authoritative, academic, transparent
   ============================================ */

:root {
  --wiki-bg: #f6f6f6;
  --wiki-white: #ffffff;
  --wiki-border: #a2a9b1;
  --wiki-link: #0645ad;
  --wiki-link-visited: #0b0080;
  --wiki-link-red: #ba0000;
  --wiki-text: #202122;
  --wiki-light-bg: #f8f9fa;
  --wiki-infobox-bg: #f8f9fa;
  --wiki-heading-border: #a2a9b1;
  --wiki-accent: #cee0f2;
  --wiki-table-header: #eaecf0;
  --wiki-green: #2B7A78;
  --wiki-green-dark: #1F5F5D;
}

body {
  background: var(--wiki-bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Liberation Sans', 'Helvetica Neue', sans-serif;
  color: var(--wiki-text);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ===== WIKI PAGE WRAPPER ===== */
.wiki-page {
  background: var(--wiki-white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  min-height: 100vh;
}

@media (min-width: 1200px) {
  .wiki-page {
    max-width: 1100px;
    margin: 0 auto;
  }
}

.wiki-content {
  padding: 1.5rem 2rem 3rem;
  max-width: 960px;
  margin: 0 auto;
}

/* ===== WIKI TABS ===== */
.wiki-tabs {
  display: flex;
  gap: 0;
  font-size: 0.8rem;
  padding: 0 1.5rem;
  background: #f8f9fa;
  border-bottom: 1px solid var(--wiki-border);
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.wiki-tab {
  padding: 0.5rem 1rem;
  color: var(--wiki-link);
  white-space: nowrap;
  cursor: default;
  position: relative;
  bottom: -1px;
  text-decoration: none;
  flex-shrink: 0;
}

.wiki-tab.active {
  background: #fff;
  border: 1px solid var(--wiki-border);
  border-bottom: 1px solid #fff;
  color: #000;
  font-weight: 700;
}

.wiki-tab:not(.active) {
  background: #eaecf0;
  border: 1px solid var(--wiki-border);
  border-bottom: 1px solid var(--wiki-border);
}

/* ===== WIKI HEADINGS ===== */
.wiki-content h1 {
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
  font-size: 1.8rem;
  font-weight: 400;
  border-bottom: 1px solid var(--wiki-heading-border);
  padding-bottom: 0.3rem;
  margin: 0 0 1rem;
  color: #000;
  line-height: 1.3;
}

.wiki-content h2 {
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
  font-size: 1.5rem;
  font-weight: 400;
  border-bottom: 1px solid var(--wiki-heading-border);
  padding-bottom: 0.17rem;
  margin: 1.8rem 0 0.75rem;
  color: #000;
}

.wiki-content h3 {
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.4rem 0 0.5rem;
  color: #000;
}

.wiki-content h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.2rem 0 0.4rem;
}

.wiki-content p {
  margin: 0.5rem 0 1rem;
  font-size: 0.9375rem;
}

.wiki-content ul, .wiki-content ol {
  margin: 0.3rem 0 1rem 1.6rem;
  padding: 0;
  font-size: 0.9375rem;
}

.wiki-content li {
  margin-bottom: 0.25rem;
}

.wiki-content a {
  color: var(--wiki-link);
  text-decoration: none;
}
.wiki-content a:hover {
  text-decoration: underline;
}
.wiki-content a:visited {
  color: var(--wiki-link-visited);
}

/* ===== HATNOTE ===== */
.wiki-hatnote {
  font-style: italic;
  padding: 0.3rem 1.5rem;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 0.3rem;
}

/* ===== INFOBOX ===== */
.wiki-infobox {
  float: right;
  width: 270px;
  background: var(--wiki-infobox-bg);
  border: 1px solid var(--wiki-border);
  padding: 0.5em;
  margin: 0.5rem 0 1.5rem 1.5rem;
  font-size: 0.8rem;
  line-height: 1.5;
  clear: right;
}

.wiki-infobox .infobox-title {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  padding: 0.3em 0;
  background: var(--wiki-accent);
  margin: -0.5em -0.5em 0.5em;
}

.wiki-infobox .infobox-image {
  text-align: center;
  padding: 0.5em 0;
}

.wiki-infobox .infobox-image img {
  max-width: 100%;
  height: auto;
}

.wiki-infobox table {
  width: 100%;
}

.wiki-infobox th {
  text-align: left;
  vertical-align: top;
  padding: 0.2em 0.4em;
  font-weight: 400;
  color: #555;
  width: 40%;
  white-space: nowrap;
}

.wiki-infobox td {
  vertical-align: top;
  padding: 0.2em 0.4em;
}

/* ===== TABLE OF CONTENTS ===== */
.wiki-toc {
  background: var(--wiki-light-bg);
  border: 1px solid var(--wiki-border);
  font-size: 0.85rem;
  padding: 0.5em 1em;
  margin: 1rem 0 1.5rem;
  display: inline-block;
  min-width: 280px;
}

.wiki-toc .toc-title {
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.3em;
}

.wiki-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wiki-toc > ul {
  margin-left: 0;
}

.wiki-toc ul ul {
  margin-left: 1.5em;
}

.wiki-toc .toc-number {
  color: #555;
}

/* ===== QUOTE BOX ===== */
.wiki-quote {
  background: var(--wiki-light-bg);
  border-left: 4px solid var(--wiki-accent);
  padding: 0.75rem 1.25rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}

/* ===== WIKI TABLE ===== */
.wiki-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.875rem;
}

.wiki-table th {
  background: var(--wiki-table-header);
  text-align: left;
  padding: 0.4em 0.6em;
  border: 1px solid var(--wiki-border);
  font-weight: 700;
}

.wiki-table td {
  padding: 0.4em 0.6em;
  border: 1px solid var(--wiki-border);
  vertical-align: top;
}

.wiki-table tr:nth-child(even) td {
  background: #f8f9fa;
}

/* ===== REFERENCES ===== */
.wiki-references {
  font-size: 0.85rem;
  column-count: 2;
  column-gap: 2rem;
}

.wiki-references ol {
  margin: 0.3rem 0 1rem 1.6rem !important;
}

.wiki-references li {
  margin-bottom: 0.4rem;
}

/* ===== NAVBOX ===== */
.wiki-navbox {
  border: 1px solid var(--wiki-border);
  font-size: 0.85rem;
  margin: 2rem 0 1rem;
  clear: both;
}

.wiki-navbox .navbox-title {
  background: var(--wiki-accent);
  text-align: center;
  padding: 0.3rem;
  font-weight: 700;
}

.wiki-navbox .navbox-body {
  padding: 0.5rem 1rem;
}

/* ===== CATEGORIES ===== */
.wiki-categories {
  background: var(--wiki-light-bg);
  border: 1px solid var(--wiki-border);
  padding: 0.5rem 1rem;
  margin: 1.5rem 0;
  font-size: 0.85rem;
}

/* ===== AMBASSADOR BOX ===== */
.wiki-ambox {
  display: flex;
  background: #fef6e7;
  border: 1px solid #fc3;
  padding: 0.5rem 1rem;
  margin: 0.5rem 0 1rem;
  font-size: 0.875rem;
  align-items: flex-start;
  gap: 0.5rem;
}

.wiki-ambox.ambox-green {
  background: #f0faf0;
  border-color: #a3d3a3;
}
.wiki-ambox.ambox-blue {
  background: #eef4fb;
  border-color: #9ab8e0;
}

/* ===== SIDEBAR NAV ===== */
.wiki-sidebar {
  float: left;
  width: 170px;
  font-size: 0.8rem;
  padding: 1rem 0.75rem;
  margin-right: 2rem;
  display: none;
}

@media (min-width: 992px) {
  .wiki-sidebar {
    display: block;
  }
}

.wiki-sidebar .sidebar-logo {
  text-align: center;
  margin-bottom: 1rem;
}

.wiki-sidebar .sidebar-logo img {
  max-width: 135px;
}

.wiki-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wiki-sidebar li {
  padding: 0.3rem 0;
}

.wiki-sidebar a {
  color: var(--wiki-link);
  text-decoration: none;
}

.wiki-sidebar a:hover {
  text-decoration: underline;
}

.wiki-sidebar .sidebar-section {
  font-weight: 700;
  color: #555;
  margin-top: 0.8rem;
  padding-top: 0.5rem;
  border-top: 1px solid #ddd;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== MAIN WITH SIDEBAR ===== */
.wiki-main {
  overflow: hidden;
}

/* ===== WIKI BUTTONS ===== */
.wiki-btn {
  display: inline-block;
  background: #f8f9fa;
  border: 1px solid var(--wiki-border);
  color: var(--wiki-link);
  font-weight: 700;
  padding: 0.4rem 1rem;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.15s;
}
.wiki-btn:hover {
  background: #fff;
  text-decoration: none;
  color: var(--wiki-link);
}

.wiki-btn-primary {
  background: var(--wiki-green);
  border-color: var(--wiki-green-dark);
  color: #fff;
}
.wiki-btn-primary:hover {
  background: var(--wiki-green-dark);
  color: #fff;
}

/* ===== WIKI FORM ===== */
.wiki-form .form-control {
  border: 1px solid var(--wiki-border);
  border-radius: 2px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  background: #fff;
  transition: border-color 0.15s;
}
.wiki-form .form-control:focus {
  border-color: #36c;
  box-shadow: 0 0 0 1px #36c;
  outline: none;
}
.wiki-form label {
  font-weight: 600;
  font-size: 0.875rem;
  color: #000;
  margin-bottom: 0.25rem;
}

/* ===== WIKI FOOTER ===== */
.wiki-footer {
  border-top: 1px solid var(--wiki-border);
  padding: 1.5rem 2rem;
  font-size: 0.75rem;
  color: #555;
  max-width: 960px;
  margin: 0 auto;
}

.wiki-footer a {
  color: var(--wiki-link);
}

.wiki-footer ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}

.wiki-footer li {
  margin-bottom: 0.25rem;
}

/* ===== TOAST ===== */
.custom-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #202122;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 2px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  animation: slideUp 0.4s ease, fadeOut 0.4s ease 3.5s forwards;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .wiki-infobox {
    float: none;
    width: 100%;
    margin: 1rem 0;
  }

  .wiki-references {
    column-count: 1;
  }

  .wiki-content {
    padding: 1rem;
  }

  .wiki-footer ul {
    flex-direction: column;
    gap: 0.25rem;
  }
}

html { scroll-behavior: smooth; }
/* ============================================
   ТЕМА «Association of Applied Psychologists» — AAPsych.org
   Global directory of vetted applied psychologists
   Wiki-style: authoritative, academic, trustworthy
   ============================================ */

:root {
  --encyclopedia-bg: #f2f4f7;
  --encyclopedia-white: #ffffff;
  --encyclopedia-accent: #142b4b;
  --encyclopedia-accent-light: #e3eaf3;
  --encyclopedia-link: #1a4a78;
  --encyclopedia-link-hover: #0e3255;
  --encyclopedia-heading: #111827;
  --encyclopedia-border: #c4c8ce;
  --encyclopedia-toc-bg: #eef1f6;
  --encyclopedia-ambox-bg: #fdfaf2;
  --encyclopedia-ambox-border: #d4b960;
  --encyclopedia-ambox-green-bg: #ecf5ef;
  --encyclopedia-ambox-green-border: #6daa80;
--encyclopedia-ambox-blue-bg: #eef4fb;
  --encyclopedia-ambox-blue-border: #9ab8e0;
  --encyclopedia-navbox-title: #d8dfe8;
  --encyclopedia-infobox-title: #d8dfe8;
  --encyclopedia-table-stripe: #f6f7fa;
  --encyclopedia-footer-text: #5a5f68;
}

/* ===== BODY OVERRIDE ===== */
body {
  background: var(--encyclopedia-bg);
  overflow-x: hidden;
}

/* ===== WIKI PAGE — тёплый оттенок + защита от горизонтального скролла ===== */
.wiki-page {
  background: var(--encyclopedia-white);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow-x: hidden;
}

/* ===== TABS — энциклопедический стиль ===== */
.wiki-tabs {
  background: #f0ede7;
  border-bottom: 1px solid var(--encyclopedia-border);
  padding: 0 1.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
  overscroll-behavior-x: contain;
}

/* Скрываем полосу прокрутки в WebKit-браузерах, но сохраняем функциональность */
.wiki-tabs::-webkit-scrollbar {
  height: 4px;
}
.wiki-tabs::-webkit-scrollbar-track {
  background: transparent;
}
.wiki-tabs::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

.wiki-tab {
  padding: 0.5rem 1.2rem;
  font-size: 0.82rem;
  color: #555;
  font-weight: 500;
  letter-spacing: 0.2px;
  flex-shrink: 0;
  white-space: nowrap;
}

.wiki-tab.active {
  background: var(--encyclopedia-white);
  border: 1px solid var(--encyclopedia-border);
  border-bottom: 1px solid var(--encyclopedia-white);
  color: var(--encyclopedia-heading);
  font-weight: 700;
}

.wiki-tab:not(.active) {
  background: #e8e4dc;
  border: 1px solid var(--encyclopedia-border);
  border-bottom: 1px solid var(--encyclopedia-border);
  color: var(--encyclopedia-link);
}
.wiki-tab:not(.active):hover {
  background: #f0ede7;
  text-decoration: none;
  color: var(--encyclopedia-link-hover);
}

/* ===== HEADINGS — Linux Libertine + тёплый оттенок ===== */
.wiki-content h1 {
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
  font-size: 2rem;
  font-weight: 400;
  border-bottom: 1px solid var(--encyclopedia-border);
  padding-bottom: 0.35rem;
  margin: 0.25rem 0 1rem;
  color: var(--encyclopedia-heading);
  letter-spacing: -0.3px;
}

.wiki-content h2 {
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
  font-size: 1.55rem;
  font-weight: 400;
  border-bottom: 1px solid var(--encyclopedia-border);
  padding-bottom: 0.18rem;
  margin: 2rem 0 0.75rem;
  color: var(--encyclopedia-heading);
}

.wiki-content h3 {
  font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  color: var(--encyclopedia-heading);
}

/* ===== LINKS — тёплый бирюзовый ===== */
.wiki-content a {
  color: var(--encyclopedia-link);
}
.wiki-content a:hover {
  color: var(--encyclopedia-link-hover);
}
.wiki-content a:visited {
  color: #4a7c79;
}

/* ===== HATNOTE ===== */
.wiki-hatnote {
  font-style: italic;
  padding: 0.4rem 0;
  font-size: 0.875rem;
  color: #777;
  margin-bottom: 0.5rem;
}

/* ===== INFOBOX — энциклопедический ===== */
.wiki-infobox {
  float: right;
  width: 275px;
  background: #fdfcf9;
  border: 1px solid var(--encyclopedia-border);
  padding: 0.5em;
  margin: 0.5rem 0 1.5rem 1.5rem;
  font-size: 0.8rem;
  line-height: 1.5;
  clear: right;
  border-radius: 3px;
}

.wiki-infobox .infobox-title {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  padding: 0.35em 0;
  background: var(--encyclopedia-infobox-title);
  margin: -0.5em -0.5em 0.5em;
  color: var(--encyclopedia-heading);
  letter-spacing: 0.3px;
}

.wiki-infobox .infobox-image {
  text-align: center;
  padding: 0.5em 0;
}

.wiki-infobox .infobox-image img {
  max-width: 100%;
  height: auto;
  border-radius: 2px;
}

.wiki-infobox table {
  width: 100%;
}

.wiki-infobox th {
  text-align: left;
  vertical-align: top;
  padding: 0.2em 0.4em;
  font-weight: 400;
  color: #888;
  width: 40%;
  white-space: nowrap;
}

.wiki-infobox td {
  vertical-align: top;
  padding: 0.2em 0.4em;
  color: #333;
}

/* ===== TOC — тёплый ===== */
.wiki-toc {
  background: var(--encyclopedia-toc-bg);
  border: 1px solid var(--encyclopedia-border);
  font-size: 0.875rem;
  padding: 0.6em 1.2em;
  margin: 1.2rem 0 1.5rem;
  display: inline-block;
  min-width: 280px;
  border-radius: 2px;
}

.wiki-toc .toc-title {
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.4em;
  color: var(--encyclopedia-heading);
  font-size: 0.95rem;
}

/* ===== QUOTE BOX ===== */
.wiki-quote {
  background: var(--encyclopedia-toc-bg);
  border-left: 4px solid var(--encyclopedia-accent);
  padding: 0.85rem 1.35rem;
  margin: 1.2rem 0;
  font-size: 0.9rem;
  border-radius: 0 3px 3px 0;
}

/* ===== WIKI TABLE ===== */
.wiki-table th {
  background: #eeebe4;
  padding: 0.5em 0.7em;
  border: 1px solid var(--encyclopedia-border);
  font-weight: 700;
  color: var(--encyclopedia-heading);
}

.wiki-table td {
  padding: 0.5em 0.7em;
  border: 1px solid var(--encyclopedia-border);
  vertical-align: top;
}

.wiki-table tr:nth-child(even) td {
  background: var(--encyclopedia-table-stripe);
}

/* ===== AMBOX ===== */
.wiki-ambox {
  display: flex;
  background: var(--encyclopedia-ambox-bg);
  border: 1px solid var(--encyclopedia-ambox-border);
  padding: 0.6rem 1.1rem;
  margin: 0.5rem 0 1rem;
  font-size: 0.875rem;
  align-items: flex-start;
  gap: 0.6rem;
  border-radius: 3px;
}

.wiki-ambox.ambox-green {
  background: var(--encyclopedia-ambox-green-bg);
  border-color: var(--encyclopedia-ambox-green-border);
}
.wiki-ambox.ambox-blue {
  background: var(--encyclopedia-ambox-blue-bg);
  border-color: var(--encyclopedia-ambox-blue-border);
}

/* ===== NAVBOX ===== */
.wiki-navbox {
  border: 1px solid var(--encyclopedia-border);
  font-size: 0.85rem;
  margin: 2rem 0 1rem;
  clear: both;
  border-radius: 2px;
}

.wiki-navbox .navbox-title {
  background: var(--encyclopedia-navbox-title);
  text-align: center;
  padding: 0.35rem;
  font-weight: 700;
  color: var(--encyclopedia-heading);
}

/* ===== CATEGORIES ===== */
.wiki-categories {
  background: var(--encyclopedia-toc-bg);
  border: 1px solid var(--encyclopedia-border);
  padding: 0.6rem 1.1rem;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  border-radius: 2px;
}

/* ===== BUTTONS ===== */
.wiki-btn {
  display: inline-block;
  background: #f5f2ec;
  border: 1px solid var(--encyclopedia-border);
  color: var(--encyclopedia-link);
  font-weight: 600;
  padding: 0.45rem 1.1rem;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.15s;
  border-radius: 3px;
}
.wiki-btn:hover {
  background: #fff;
  text-decoration: none;
  color: var(--encyclopedia-link-hover);
  border-color: var(--encyclopedia-accent);
}

.wiki-btn-primary {
  background: var(--encyclopedia-accent);
  border-color: var(--encyclopedia-accent);
  color: #fff;
}
.wiki-btn-primary:hover {
  background: #144e4c;
  color: #fff;
}

/* ===== FORM ===== */
.wiki-form .form-control {
  border: 1px solid var(--encyclopedia-border);
  border-radius: 3px;
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
  background: #fffefb;
  transition: border-color 0.15s;
}
.wiki-form .form-control:focus {
  border-color: var(--encyclopedia-accent);
  box-shadow: 0 0 0 2px rgba(26,92,90,0.1);
  outline: none;
}
.wiki-form label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--encyclopedia-heading);
  margin-bottom: 0.3rem;
}

/* ===== FOOTER ===== */
.wiki-footer {
  border-top: 1px solid var(--encyclopedia-border);
  padding: 1.5rem 2rem;
  font-size: 0.78rem;
  color: var(--encyclopedia-footer-text);
  max-width: 960px;
  margin: 0 auto;
}

.wiki-footer a {
  color: var(--encyclopedia-link);
}

/* ===== TOAST ===== */
.custom-toast {
  background: var(--encyclopedia-heading);
  border-radius: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .wiki-infobox {
    float: none;
    width: 100%;
    margin: 1rem 0;
  }
  .wiki-references {
    column-count: 1;
  }
  .wiki-content {
    padding: 1rem;
  }
  .wiki-footer ul {
    flex-direction: column;
    gap: 0.25rem;
  }
}

@media (min-width: 1200px) {
  .wiki-page {
    max-width: 1120px;
    margin: 0 auto;
  }
}

html { scroll-behavior: smooth; }

/* ===== SCROLLABLE TABLES ON MOBILE ===== */
@media (max-width: 767.98px) {
  .wiki-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
}
/* ===== MESSENGER ACTION BUTTONS ===== */
.msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1rem 0 0.5rem;
}

.msg-action {
  --msg-color: #142b4b;
  --msg-tint: rgba(20, 43, 75, 0.08);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 212px;
  padding: 0.55rem 0.85rem 0.55rem 0.55rem;
  background: #fff;
  border: 1px solid var(--encyclopedia-border, #d7dee8);
  border-radius: 14px;
  color: #142b4b;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}

.msg-action::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--msg-color);
  opacity: 0.75;
  transition: opacity 0.18s ease, width 0.18s ease;
}

.msg-action__icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--msg-tint);
  color: var(--msg-color);
  font-size: 1.2rem;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.msg-action__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
  min-width: 0;
}

.msg-action__text strong {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.msg-action__text small {
  font-size: 0.72rem;
  font-weight: 500;
  color: #6b7686;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-action__arrow {
  margin-left: auto;
  font-size: 0.95rem;
  color: #9aa5b4;
  transition: transform 0.18s ease, color 0.18s ease;
}

.msg-action:hover {
  transform: translateY(-2px);
  border-color: var(--msg-color);
  box-shadow: 0 12px 24px -10px rgba(16, 24, 40, 0.35);
  color: #142b4b;
  text-decoration: none;
}

.msg-action:hover::before {
  width: 4px;
  opacity: 1;
}

.msg-action:hover .msg-action__icon {
  background: var(--msg-color);
  color: #fff;
  transform: scale(1.04);
}

.msg-action:hover .msg-action__arrow {
  color: var(--msg-color);
  transform: translate(2px, -2px);
}

.msg-action:focus-visible {
  outline: 2px solid var(--msg-color);
  outline-offset: 2px;
}

.msg-action--tg {
  --msg-color: #2196d2;
  --msg-tint: rgba(34, 158, 217, 0.13);
}

.msg-action--wa {
  --msg-color: #1ea855;
  --msg-tint: rgba(37, 211, 102, 0.15);
}

.msg-action--max {
  --msg-color: #6d4aff;
  --msg-tint: rgba(109, 74, 255, 0.13);
}

/* Инлайн-вариант внутри карточек и на цветном фоне */
.msg-actions--sm .msg-action {
  min-width: 0;
  padding: 0.45rem 0.7rem 0.45rem 0.45rem;
  border-radius: 12px;
}

.msg-actions--sm .msg-action__icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 9px;
  font-size: 1rem;
}

.msg-actions--sm .msg-action__text small {
  display: none;
}

@media (max-width: 575.98px) {
  .msg-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  .msg-action {
    width: 100%;
    min-width: 0;
  }
  .msg-actions--sm {
    flex-direction: row;
  }
  .msg-actions--sm .msg-action {
    width: auto;
    flex: 1 1 auto;
  }
}

/* ============================================
   ИССЛЕДОВАТЕЛЬСКАЯ ПАНЕЛЬ АПП — research.html
   ============================================ */

/* Метка «New» во вкладке навигации */
.tab-new {
  display: inline-block;
  margin-left: 0.28rem;
  padding: 0 0.34rem;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #b3261e;
  background: #fdecea;
  border: 1px solid #f0bdb7;
  border-radius: 999px;
  line-height: 1.6;
  vertical-align: middle;
}
.wiki-tab.active .tab-new {
  color: #fff;
  background: #b3261e;
  border-color: #b3261e;
}

/* Первый экран */
.rp-hero {
  background: linear-gradient(158deg, #f8fafc 0%, #eef2f7 58%, #e8eef6 100%);
  border: 1px solid var(--encyclopedia-border);
  border-radius: 5px;
  padding: 1.5rem 1.6rem 1.35rem;
  margin: 0 0 1.3rem;
  clear: both;
}
.rp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1f5f5d;
}
.rp-hero h2 {
  border: 0;
  margin: 0.4rem 0 0.65rem;
  padding: 0;
  font-size: 1.75rem;
  line-height: 1.24;
  max-width: 30ch;
}
.rp-hero p {
  font-size: 0.94rem;
  color: #3b4149;
  max-width: 62ch;
  margin-bottom: 0;
}
.rp-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.05rem;
}
.rp-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1.05rem;
}
.rp-chip {
  font-size: 0.73rem;
  color: #3b4149;
  background: #fff;
  border: 1px solid #d7dee8;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}
.rp-btn-lg {
  padding: 0.58rem 1.2rem;
  font-size: 0.92rem;
}

/* Быстрый переход по аудиториям */
.rp-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.4rem;
}
.rp-jump a {
  display: inline-block;
  font-size: 0.77rem;
  font-weight: 600;
  color: #142b4b;
  background: #f5f2ec;
  border: 1px solid var(--encyclopedia-border);
  border-radius: 999px;
  padding: 0.24rem 0.68rem;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.rp-jump a:hover {
  background: #fff;
  border-color: #142b4b;
  color: #0e3255;
  text-decoration: none;
}

/* Сетка карточек */
.rp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 1.3rem;
}
.rp-card {
  border: 1px solid var(--encyclopedia-border);
  border-radius: 4px;
  background: #fff;
  padding: 0.9rem 1rem;
}
.rp-card--accent {
  border-left: 3px solid #1f5f5d;
  background: #fcfdfd;
}
.rp-card--muted {
  background: #fdfcf9;
}
.rp-card__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eef2f7;
  color: #142b4b;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}
.rp-card h3,
.rp-card h4 {
  margin: 0 0 0.4rem;
  font-size: 0.98rem;
  border: 0;
  padding: 0;
}
.rp-card p {
  font-size: 0.85rem;
  margin-bottom: 0.45rem;
}
.rp-card p:last-child {
  margin-bottom: 0;
}
.rp-card__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7686;
  margin-bottom: 0.25rem;
}

/* Путь участника */
.rp-steps {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.2rem;
  counter-reset: rp-step;
}
.rp-steps li {
  position: relative;
  padding: 0 0 0.8rem 2.15rem;
  font-size: 0.87rem;
  line-height: 1.5;
}
.rp-steps li:last-child {
  padding-bottom: 0;
}
.rp-steps li::before {
  counter-increment: rp-step;
  content: counter(rp-step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #142b4b;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.rp-steps li::after {
  content: "";
  position: absolute;
  left: 0.72rem;
  top: 1.6rem;
  bottom: 0.1rem;
  width: 1px;
  background: #d7dee8;
}
.rp-steps li:last-child::after {
  display: none;
}

/* Маршрут заказчика */
.rp-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0.8rem 0 1.2rem;
}
.rp-flow li {
  font-size: 0.77rem;
  background: #eef2f7;
  border: 1px solid #d7dee8;
  border-radius: 999px;
  padding: 0.26rem 0.68rem;
  margin: 0;
}
.rp-flow li:not(:first-child)::before {
  content: "›";
  margin-right: 0.42rem;
  color: #8a929c;
  font-weight: 700;
}

/* FAQ-аккордеон */
.rp-faq {
  border: 1px solid var(--encyclopedia-border);
  border-radius: 4px;
  background: #fdfcf9;
  margin: 0.5rem 0;
}
.rp-faq summary {
  cursor: pointer;
  padding: 0.7rem 0.95rem;
  font-weight: 700;
  font-size: 0.89rem;
  color: var(--encyclopedia-heading);
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.rp-faq summary::-webkit-details-marker {
  display: none;
}
.rp-faq summary::after {
  content: "+";
  margin-left: auto;
  color: #8a929c;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
}
.rp-faq[open] summary::after {
  content: "−";
}
.rp-faq[open] summary {
  border-bottom: 1px solid #e6e2d8;
}
.rp-faq .rp-faq__body {
  padding: 0.7rem 0.95rem 0.8rem;
  font-size: 0.86rem;
  color: #3b4149;
}

/* Формы */
.rp-forms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}
.rp-form-card {
  border: 1px solid var(--encyclopedia-border);
  border-radius: 5px;
  background: #fbfcfd;
  padding: 1.05rem 1.1rem 1.2rem;
}
.rp-form-card > h3 {
  margin: 0 0 0.2rem;
  border: 0;
  padding: 0;
  font-size: 1.05rem;
}
.rp-form-card__sub {
  font-size: 0.78rem;
  color: #6b7686;
  margin-bottom: 0.8rem;
}
.rp-form .form-group {
  margin-bottom: 0.65rem;
}
.rp-form .form-control {
  font-size: 0.87rem;
}
.rp-form .rp-hint {
  font-size: 0.71rem;
  color: #6b7686;
  margin-top: 0.2rem;
  line-height: 1.4;
}
.rp-form .rp-error {
  display: none;
  background: #fdecea;
  border: 1px solid #f0bdb7;
  color: #8c1d18;
  font-size: 0.79rem;
  padding: 0.5rem 0.7rem;
  border-radius: 3px;
  margin-bottom: 0.7rem;
}
.rp-form .rp-error.is-visible {
  display: block;
}
.rp-form .is-invalid {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.12) !important;
}
.rp-consent {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  font-size: 0.78rem !important;
  font-weight: 400 !important;
  color: #3b4149;
  line-height: 1.45;
}
.rp-consent input {
  margin-top: 0.2rem;
  flex: 0 0 auto;
}
.rp-form button[type="submit"][disabled] {
  opacity: 0.6;
  cursor: progress;
}
.rp-note {
  font-size: 0.74rem;
  color: #6b7686;
  margin-top: 0.6rem;
  line-height: 1.5;
}

/* Мелкие утилиты */
.rp-mt {
  margin-top: 1rem;
}
.rp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.9rem 0 0.3rem;
}
.rp-soft {
  background: #f8f9fa;
  border: 1px solid #e4e7ec;
  border-radius: 4px;
  padding: 0.75rem 0.95rem;
  font-size: 0.82rem;
  color: #3b4149;
  margin: 0.9rem 0;
}

@media (max-width: 991.98px) {
  .rp-forms {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 767.98px) {
  .rp-grid {
    grid-template-columns: 1fr;
  }
  .rp-hero {
    padding: 1.15rem 1.05rem;
  }
  .rp-hero h2 {
    font-size: 1.4rem;
  }
  .rp-hero__actions .wiki-btn {
    width: 100%;
    text-align: center;
  }
}
