/* t1365u: logged-in header avatar dropdown (ЮР / ФИЗ), both themes, desktop + burger */
.ks-hm-bal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.ks-hm-bal__n {
  font-size: 13px;
  line-height: 1.3;
  font-family: "Inter-Regular", Inter, system-ui, sans-serif;
  color: #6b7280;
}
.ks-hm-topup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: #e23737;
  color: #fff !important;
  font-size: 13px;
  line-height: 1;
  font-family: "Inter-SemiBold", Inter, system-ui, sans-serif;
  text-decoration: none !important;
  white-space: nowrap;
}
.ks-hm-topup:hover {
  background: #c92c2c;
  color: #fff !important;
}
.header-profile-title .ks-hm-bal,
.header-burger-acc-title-block .ks-hm-bal {
  width: 100%;
}
.header-profile-block .header-profile-menu {
  gap: 4px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
}
.header-profile-menu-item.ks-hm-item,
.header-burger-acc-menu .header-profile-menu-item.ks-hm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.header-profile-menu-item.ks-hm-item:hover,
.header-burger-acc-menu .header-profile-menu-item.ks-hm-item:hover {
  background: rgba(0, 0, 0, 0.05);
}
.header-profile-menu-item.ks-hm-item > span,
.header-burger-acc-menu .header-profile-menu-item.ks-hm-item > span {
  flex: 1 1 auto;
  font-size: 15px;
  line-height: 1.25;
}
.ks-hm-ico {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  color: #353433;
}
.header-profile-menu-item.ks-hm-item img,
.header-burger-acc-menu .header-profile-menu-item.ks-hm-item img {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}
.ks-hm-count {
  margin-left: auto;
  min-width: 22px;
  padding: 0 7px;
  height: 20px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #353433;
  font-size: 12px;
  font-weight: 600;
  font-family: "Inter-SemiBold", Inter, system-ui, sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.ks-hm-unread {
  display: none;
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e23737;
  flex: 0 0 8px;
}
.ks-hm-item.is-unread .ks-hm-unread {
  display: inline-block;
}
.header-burger-acc-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.header-burger-acc-menu .ks-hm-item {
  justify-content: flex-start;
}

/* Dark theme (LK + public if data-ks-theme is set) */
html[data-ks-theme="dark"] .ks-hm-bal__n {
  color: #9aa3ad;
}
html[data-ks-theme="dark"] .ks-hm-ico {
  color: #e8eaed;
}
html[data-ks-theme="dark"] .header-profile-menu-item.ks-hm-item:hover,
html[data-ks-theme="dark"] .header-burger-acc-menu .header-profile-menu-item.ks-hm-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
html[data-ks-theme="dark"] .ks-hm-count {
  background: #2a3038;
  color: #f2f4f7;
}
html[data-ks-theme="dark"] .header-profile-menu-item.ks-hm-item,
html[data-ks-theme="dark"] .header-burger-acc-menu .header-profile-menu-item.ks-hm-item {
  color: #f2f4f7;
}

@media (max-width: 1000px) {
  .header-burger-acc-title-block .ks-hm-bal {
    margin-top: 8px;
  }
  .header-burger-acc-menu .ks-hm-item > span {
    font-size: 16px;
  }
}

/* Keep logout visible; compact long ЮР/ФИЗ lists */
.header-profile-block .header-profile-menu {
  gap: 2px;
  max-height: min(72vh, 640px);
  overflow-y: auto;
  padding-bottom: 4px;
}
.header-profile-block .header-profile-menu > .header-profile-menu-item-exit,
.header-profile-block.ks-lk-hm .header-profile-menu > .header-profile-menu-item-exit {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 4px;
  background: #fff;
  box-shadow: 0 -8px 10px -8px rgba(0,0,0,.12);
}
html[data-ks-theme="dark"] .header-profile-block .header-profile-menu > .header-profile-menu-item-exit,
html[data-ks-theme="dark"] .header-profile-block.ks-lk-hm .header-profile-menu > .header-profile-menu-item-exit {
  background: var(--ks-surface, #1c1f24);
}
.header-profile-menu-item.ks-hm-item,
.header-burger-acc-menu .header-profile-menu-item.ks-hm-item {
  padding: 6px 8px;
}
body.ks-lk .ks-lk-hm-theme,
body.ks-lk .header-profile-menu .ks-lk-hm-theme[data-ks-lk-hm-theme] {
  gap: 2px !important;
  margin: 0 !important;
}
body.ks-lk .ks-lk-hm-theme__btn,
body.ks-lk .header-profile-menu .ks-lk-hm-theme button[data-ks-theme-set] {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

/* Burger acc must sit above the LK mobile cabinet sheet (z-index 10050) */
@media (max-width: 1000px) {
  .header-burger-wrapper.show,
  .header-burger-wrapper.menu-show {
    z-index: 12000 !important;
  }
}

/* t1373u: one outline style, 20px, muted color; red only for Выйти and unread dot */
.header-profile-menu-item.ks-hm-item .ks-hm-ico,
.header-burger-acc-menu .header-profile-menu-item.ks-hm-item .ks-hm-ico,
.header-profile-menu-item-exit .ks-hm-ico {
  flex: 0 0 20px;
  width: 20px !important;
  height: 20px !important;
  color: #6B7280;
  fill: none !important;
  stroke: #6B7280 !important;
  stroke-width: 1.75;
}
.header-profile-menu-item.ks-hm-item .ks-hm-ico *,
.header-burger-acc-menu .header-profile-menu-item.ks-hm-item .ks-hm-ico *,
.header-profile-menu-item-exit .ks-hm-ico * {
  fill: none !important;
  stroke: #6B7280 !important;
  stroke-width: 1.75 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}
.header-profile-menu-item.ks-hm-item:hover,
.header-burger-acc-menu .header-profile-menu-item.ks-hm-item:hover {
  color: #111827;
}
.header-profile-menu-item.ks-hm-item:hover .ks-hm-ico,
.header-profile-menu-item.ks-hm-item:hover .ks-hm-ico *,
.header-burger-acc-menu .header-profile-menu-item.ks-hm-item:hover .ks-hm-ico,
.header-burger-acc-menu .header-profile-menu-item.ks-hm-item:hover .ks-hm-ico * {
  color: #111827;
  stroke: #111827 !important;
}
html[data-ks-theme="dark"] .header-profile-menu-item.ks-hm-item .ks-hm-ico,
html[data-ks-theme="dark"] .header-burger-acc-menu .header-profile-menu-item.ks-hm-item .ks-hm-ico,
html[data-ks-theme="dark"] .header-profile-menu-item.ks-hm-item .ks-hm-ico *,
html[data-ks-theme="dark"] .header-burger-acc-menu .header-profile-menu-item.ks-hm-item .ks-hm-ico * {
  color: #9CA3AF;
  stroke: #9CA3AF !important;
  fill: none !important;
}
html[data-ks-theme="dark"] .header-profile-menu-item.ks-hm-item:hover,
html[data-ks-theme="dark"] .header-burger-acc-menu .header-profile-menu-item.ks-hm-item:hover {
  color: #F3F4F6;
}
html[data-ks-theme="dark"] .header-profile-menu-item.ks-hm-item:hover .ks-hm-ico,
html[data-ks-theme="dark"] .header-profile-menu-item.ks-hm-item:hover .ks-hm-ico *,
html[data-ks-theme="dark"] .header-burger-acc-menu .header-profile-menu-item.ks-hm-item:hover .ks-hm-ico,
html[data-ks-theme="dark"] .header-burger-acc-menu .header-profile-menu-item.ks-hm-item:hover .ks-hm-ico * {
  color: #F3F4F6;
  stroke: #F3F4F6 !important;
}
.header-profile-menu-item-exit .ks-hm-ico,
.header-profile-menu-item-exit .ks-hm-ico *,
.header-profile-menu-item.header-profile-menu-item-exit .ks-hm-ico,
.header-profile-menu-item.header-profile-menu-item-exit .ks-hm-ico *,
.header-burger-acc-menu .header-profile-menu-item-exit .ks-hm-ico,
.header-burger-acc-menu .header-profile-menu-item-exit .ks-hm-ico * {
  color: #E23737 !important;
  stroke: #E23737 !important;
  fill: none !important;
}
.ks-hm-unread {
  background: #E23737;
}
