.ama-essential-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 20px;
}

.ama-essential-actions--compact {
  justify-content: flex-end;
  max-width: 1560px;
  margin: 8px auto 10px;
  padding: 0 20px;
}

.ama-essential-actions__link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  border: 1px solid #0b62c4;
  border-radius: 12px;
  color: #0757aa;
  background: #fff;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.ama-essential-actions__link:hover,
.ama-essential-actions__link:focus-visible {
  color: #fff;
  background: #075fc7;
  outline: 3px solid rgba(7, 95, 199, .2);
  outline-offset: 2px;
}

.ama-essential-actions__link--primary {
  color: #fff;
  background: #075fc7;
}

.ama-essential-actions__link--logout {
  border-color: #a9b4c2;
  color: #263442;
  background: #f7f9fb;
}

.ama-header-logout {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  margin-left: 8px;
  padding: 6px 12px;
  border: 1px solid #a9b4c2;
  border-radius: 999px;
  color: #263442;
  background: #f7f9fb;
  font-weight: 700;
  text-decoration: none;
}

.ama-header-logout:hover,
.ama-header-logout:focus-visible {
  color: #fff;
  background: #075fc7;
}

.ama-specialist-note {
  margin: 10px 0 18px;
  padding: 12px 14px;
  border-left: 4px solid #075fc7;
  border-radius: 10px;
  color: #17324f;
  background: #eef6ff;
  line-height: 1.45;
}

.ama-specialist-page-action {
  display: flex;
  justify-content: flex-start;
  max-width: 1180px;
  margin: 14px auto 18px;
  padding: 0 16px;
}

.ama-specialist-page-action .ama-essential-actions__link {
  min-width: 190px;
}

.ama-all-directory-categories {
  max-width: 1180px;
  margin: 22px auto 28px;
  padding: 0 16px;
}

.ama-all-directory-categories h2 {
  margin: 0 0 14px;
  color: #0a2f59;
  font-size: clamp(22px, 2.2vw, 30px);
}

.ama-all-directory-categories__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.ama-all-directory-categories__link {
  display: flex;
  min-height: 54px;
  align-items: center;
  padding: 12px 18px;
  border: 1px solid #d2deeb;
  border-radius: 14px;
  color: #0a2f59;
  background: #fff;
  font-weight: 700;
  text-decoration: none;
}

.ama-all-directory-categories__link:hover,
.ama-all-directory-categories__link:focus-visible {
  border-color: #075fc7;
  color: #075fc7;
  background: #f3f8ff;
  outline: 3px solid rgba(7, 95, 199, .16);
  outline-offset: 2px;
}

.ama-app .ama-directory-parent-hidden {
  display: none !important;
}

.ama-expanded-directory {
  grid-column: 1 / -1;
  width: 100%;
  margin: 22px 0 30px;
}

.ama-expanded-directory > h2 {
  margin: 0 0 18px;
  color: #0a2f59;
  font-size: clamp(24px, 2.5vw, 32px);
}

.ama-expanded-directory__groups {
  display: grid;
  gap: 24px;
}

.ama-expanded-directory__group {
  min-width: 0;
}

.ama-expanded-directory__title {
  display: inline-flex;
  margin-bottom: 12px;
  color: #075fc7;
  font-size: 21px;
  font-weight: 800;
  text-decoration: none;
}

.ama-expanded-directory__title:hover,
.ama-expanded-directory__title:focus-visible {
  text-decoration: underline;
}

.ama-expanded-directory__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 16px;
}

.ama-expanded-directory__item {
  display: flex;
  min-width: 0;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #d5e0ec;
  border-radius: 12px;
  color: #0a2f59;
  background: #fff;
  text-decoration: none;
}

.ama-expanded-directory__item:hover,
.ama-expanded-directory__item:focus-visible {
  border-color: #075fc7;
  color: #075fc7;
  background: #f3f8ff;
  outline: 3px solid rgba(7, 95, 199, .14);
  outline-offset: 2px;
}

.ama-expanded-directory__name {
  min-width: 0;
  font-weight: 700;
  line-height: 1.3;
}

.ama-expanded-directory__count {
  flex: 0 0 auto;
  color: #5b6e82;
  font-size: 14px;
  white-space: nowrap;
}

.ama-expanded-directory__loading {
  grid-column: 1 / -1;
  padding: 12px 0;
  color: #66788a;
}

/* Временно скрыто по решению владельца сайта. */
#am-online-count {
  display: none !important;
}

.ama-home-stats {
  width: 100%;
  max-width: 950px;
  margin: 16px auto 18px;
  padding: 18px 20px;
  border: 1px solid #c9dced;
  border-radius: 20px;
  background: #f8fbff;
}

.ama-home-stats__heading {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.ama-home-stats__accuracy {
  display: none;
}

.ama-home-stats__heading h2 {
  margin: 0;
  color: #082f58;
  font-size: clamp(21px, 2.2vw, 28px);
}

.ama-home-stats__heading-main {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.ama-home-stats__total {
  display: inline-flex;
  min-height: 42px;
  align-items: baseline;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid #a9ccef;
  border-radius: 999px;
  color: #17324f;
  background: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.ama-home-stats__total strong {
  color: #075fc7;
  font-size: 22px;
  line-height: 1;
}

.ama-home-stats__total span {
  color: #455f78;
  font-size: 13px;
}

.ama-home-stats__total:hover,
.ama-home-stats__total:focus-visible {
  border-color: #075fc7;
  background: #eef6ff;
  outline: 3px solid rgba(7,95,199,.14);
  outline-offset: 2px;
}

.ama-home-stats__heading span,
.ama-home-stats__note {
  color: #617386;
  font-size: 13px;
}

.ama-home-stats__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ama-home-stats__card {
  display: flex;
  min-width: 0;
  min-height: 108px;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid #d4e1ee;
  border-radius: 15px;
  color: #17324f;
  background: #fff;
  text-decoration: none;
}

.ama-home-stats__card:hover,
.ama-home-stats__card:focus-visible {
  border-color: #075fc7;
  box-shadow: 0 6px 18px rgba(7,95,199,.12);
  outline: 3px solid rgba(7,95,199,.14);
  outline-offset: 2px;
}

.ama-home-stats__count {
  color: #075fc7;
  font-size: 31px;
  line-height: 1.05;
}

.ama-home-stats__label {
  margin-top: 5px;
  font-weight: 800;
  line-height: 1.25;
}

.ama-home-stats__action {
  margin-top: auto;
  padding-top: 7px;
  color: #075fc7;
  font-size: 13px;
  text-decoration: underline;
}

.ama-home-stats__note {
  margin: 12px 0 0;
}

@media (max-width: 760px) {
  .ama-home-stats {
    width: auto;
    margin: 12px 16px 14px;
    padding: 14px;
    border-radius: 18px;
  }

  .ama-home-stats__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .ama-home-stats__heading-main {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .ama-home-stats__total {
    min-height: 38px;
    padding: 6px 10px;
    white-space: normal;
  }

  .ama-home-stats__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .ama-home-stats__card {
    min-height: 96px;
    padding: 11px 12px;
  }

  .ama-home-stats__count {
    font-size: 27px;
  }

  .ama-home-stats__label {
    font-size: 14px;
  }

  .ama-home-stats__note {
    font-size: 12px;
    line-height: 1.35;
  }

  .ama-essential-actions,
  .ama-essential-actions--compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: auto;
    margin: 8px 16px 14px;
    padding: 0;
  }

  .ama-essential-actions__link {
    min-width: 0;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 14px;
    text-align: center;
  }

  .ama-essential-actions__link--logout {
    grid-column: 1 / -1;
  }

  .ama-header-logout {
    min-height: 40px;
    margin-left: 4px;
    padding: 6px 10px;
    font-size: 14px;
  }

  .ama-specialist-page-action {
    margin: 10px 16px 14px;
    padding: 0;
  }

  .ama-specialist-page-action .ama-essential-actions__link {
    width: 100%;
    min-width: 0;
  }

  .ama-all-directory-categories {
    margin: 18px 16px 22px;
    padding: 0;
  }

  .ama-all-directory-categories__grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .ama-all-directory-categories__link {
    min-height: 48px;
    padding: 10px 14px;
  }

  .ama-expanded-directory {
    margin: 18px 0 24px;
  }

  .ama-expanded-directory__list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .ama-expanded-directory__item {
    min-height: 48px;
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
  }

  .ama-expanded-directory__count {
    white-space: normal;
  }
}


/* Unified home and account controls */
.ama-header-home{display:inline-flex;align-items:center;justify-content:center;flex:none;width:42px;height:42px;border:1px solid #d5e2ee;border-radius:12px;color:#0059bd!important;background:#fff;font-size:30px;line-height:1;text-decoration:none} .ama-header-home:hover,.ama-header-home:focus-visible{background:#eaf3ff} .am-home-account-group>.ama-header-logout{margin-left:10px} @media(max-width:800px){.ama-header-home,.ama-header-logout{display:none!important}.amm-ai-chat .amm-ai-header>a[href*="/edinyy-kabinet/"]{display:none!important}}
