/* Профиль: баланс, партнёрка, история операций. */
/* Порядок подключения важен: каскад зависит от последовательности файлов. */
.profile-content-balance {
  width: 1046px;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.profile-balance-page {
  width: 1046px;
  display: grid;
  gap: 16px;
}
.profile-balance-action {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #686868;
  background: transparent;
  border-radius: 10px;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.profile-balance-action span {
  width: 24px;
  height: 24px;
  display: block;
  background: currentColor;
  -webkit-mask: var(--balance-action-icon) center / contain no-repeat;
  mask: var(--balance-action-icon) center / contain no-repeat;
}
.profile-balance-action-partner {
  color: #686868;
  background: #000;
}
.profile-balance-action-partner span {
  width: 28px;
  height: 23px;
  --balance-action-icon: url("../assets/balance-partner.svg");
}
.profile-balance-hero {
  width: 1046px;
  height: 140px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  background: #000003;
  border-radius: 16px;
}
.profile-balance-half {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  overflow: hidden;
}
.profile-balance-half::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .36s ease;
  pointer-events: none;
}
.profile-balance-half:hover::before { opacity: 1; }
.profile-balance-half.rub::before { background: radial-gradient(420px 92px at 18% 100%, rgba(46,184,34,.26), rgba(46,184,34,.12) 46%, rgba(46,184,34,0) 82%); }
.profile-balance-half.gram::before { background: radial-gradient(420px 92px at 82% 100%, rgba(30,85,249,.28), rgba(30,85,249,.13) 46%, rgba(30,85,249,0) 82%); }
.profile-balance-half b {
  position: relative;
  z-index: 1;
  font: 700 48px/58px var(--font);
}
.profile-balance-half img {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.profile-affiliate-card,
.profile-balance-history {
  width: 1046px;
  overflow: hidden;
  background: #1B1B23;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px #2F2F37;
}
.profile-balance-page > .profile-affiliate-card {
  display: none;
}
.profile-affiliate-card {
  max-height: 85px;
  transition: max-height .82s cubic-bezier(.22,1,.36,1), border-radius .22s ease;
}
.profile-affiliate-card.open {
  max-height: 1200px;
  border-radius: 24px;
}
.profile-affiliate-head {
  position: relative;
  width: 100%;
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font: 400 20px/25px var(--font);
}
.profile-affiliate-head .my-channel-chevron {
  position: absolute;
  right: 0;
  top: 0;
  margin: 0;
}
.profile-affiliate-head .my-channel-chevron::before {
  transform: translate(-50%, -50%) rotate(180deg);
}
.profile-affiliate-card.open .profile-affiliate-head .my-channel-chevron::before {
  transform: translate(-50%, -50%) rotate(0);
}
.profile-affiliate-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .62s cubic-bezier(.22,1,.36,1), opacity .24s ease .12s;
}
.profile-affiliate-card.open .profile-affiliate-content {
  max-height: 1100px;
  opacity: 1;
}
.profile-affiliate-divider {
  width: 100%;
  height: 1px;
  background: #2F2F37;
}
.profile-affiliate-table {
  padding: 20px 24px 24px;
  display: grid;
  row-gap: 8px;
}
.profile-affiliate-header,
.profile-affiliate-row {
  display: grid;
  grid-template-columns: 314px 80px 100px 100px 202px 52px;
  column-gap: 30px;
  align-items: center;
}
.profile-affiliate-header {
  color: rgba(255,255,255,.75);
  font: 400 16px/20px var(--font);
}
.profile-affiliate-header span {
  text-align: center;
}
.profile-affiliate-row {
  min-height: 52px;
}
.profile-affiliate-copy {
  width: 314px;
  height: 52px;
  margin: 0;
  color: #1E55F9;
  background: rgba(30,85,249,.12);
  border-radius: 10px;
  font: 500 16px/20px var(--font);
}
.profile-affiliate-copy .copy-default b,
.profile-affiliate-copy .copy-success b {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 16px/20px var(--font);
}
.profile-affiliate-copy.copied .copy-success b {
  color: #fff;
  font: 600 16px/20px var(--font);
}
.profile-affiliate-row > b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  font: 600 20px/24px var(--font);
}
.profile-affiliate-row > b i {
  color: #2F2F37;
  font-style: normal;
}
.profile-affiliate-reward {
  gap: 8px;
}
.profile-affiliate-reward span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.profile-affiliate-reward .price-gram {
  width: .82em;
  height: .82em;
  margin-left: 0;
  vertical-align: -0.03em;
}
.profile-affiliate-delete {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 10px;
  transition: background-color .2s ease;
}
.profile-affiliate-delete:hover {
  background: rgba(230,41,41,.12);
}
.profile-affiliate-delete img { width: 20px; height: 22px; display: block; object-fit: contain; }
.profile-affiliate-add {
  grid-column: 1;
  width: 314px;
  height: 52px;
  margin-top: 0;
  color: #fff;
  background: #1E55F9;
  border-radius: 10px;
  font: 600 16px/20px var(--font);
}
.profile-affiliate-modal {
  z-index: 130;
  padding: 32px;
}
.profile-affiliate-modal-card {
  width: min(1046px, calc(100vw - 64px));
  max-height: min(760px, calc(100vh - 64px));
  padding: 0;
  overflow: hidden;
  background: #1B1B23;
  border-color: #2F2F37;
  border-radius: 24px;
  text-align: left;
}
.profile-affiliate-modal-card .modal-close {
  right: 24px;
  top: 22px;
}
.profile-affiliate-modal-card h2 {
  height: 85px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-bottom: 1px solid #2F2F37;
  font: 400 20px/25px var(--font);
}
.profile-affiliate-modal-content {
  max-height: calc(100vh - 149px);
  overflow: auto;
}
.profile-balance-history {
  padding: 0;
}
.profile-balance-history h2 {
  display: none;
  height: 85px;
  margin: 0;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-bottom: 1px solid #2F2F37;
  font: 400 20px/25px var(--font);
}
.profile-history-list {
  padding: 24px;
  display: grid;
  gap: 12px;
}
.profile-history-row {
  min-height: 30px;
  display: grid;
  grid-template-columns: 144px minmax(372px, 1fr) 180px 64px;
  column-gap: 40px;
  align-items: center;
}
.profile-history-row > span {
  min-width: 54px;
  height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #1E55F9;
  background: rgba(30,85,249,.12);
  border-radius: 8px;
  font: 500 14px/18px var(--font);
  justify-self: start;
  white-space: nowrap;
}
.profile-history-row > span.income { color: #2EB822; background: rgba(46,184,34,.12); }
.profile-history-row > span.outcome { color: #E62929; background: rgba(230,41,41,.12); }
.profile-history-row > span .price-gram {
  width: .9em;
  height: .9em;
  margin-left: 0;
  color: currentColor;
  background: currentColor;
}
.profile-history-row > span .balance-rub-sign {
  width: auto;
  min-width: 0;
  height: auto;
  padding: 0;
  display: inline;
  color: currentColor;
  background: transparent;
  border-radius: 0;
  font: inherit;
}
.profile-history-row b,
.profile-history-row time {
  color: rgba(255,255,255,.75);
  font: 400 16px/20px var(--font);
}
.profile-history-row b {
  justify-self: start;
  white-space: nowrap;
}
.profile-history-row time {
  justify-self: end;
  text-align: right;
}
.profile-history-footer {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255,255,255,.75);
  font: 400 16px/20px var(--font);
}
.profile-history-footer b { color: #fff; font-weight: 700; }
.profile-history-footer nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.profile-history-footer button {
  width: 52px;
  height: 52px;
  color: #fff;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px #1E55F9;
  font: 600 16px/20px var(--font);
}
.profile-history-footer button:hover,
.profile-history-footer button.active {
  color: #1E55F9;
  background: rgba(30,85,249,.12);
  box-shadow: none;
}

/* Menu rows are sized for 4px inner gaps, including the bottom selected item */
.profile-menu-card { gap: 4px; }
.profile-menu-title { margin-bottom: 0; }
.profile-menu-card.no-title { grid-template-rows: minmax(0, 1fr); gap: 0; }
.profile-menu-items > button { box-sizing: border-box; min-height: 62px; padding-top: 0; padding-bottom: 0; }


/* Keep active menu glow out of the blur strip below the header */
.catalog-menu::after { clip-path: inset(-80px -100px 0 -100px); }

/* Search icons: exact geometry from required inner offsets */
.catalog-search { height: 52px; padding-left: 18px; padding-right: 18px; gap: 8px; }
.catalog-search { box-shadow: inset 0 0 0 1px #2F2F37; }
.catalog-search img { position: relative; top: 0; width: 18.88px; height: 18.88px; flex: 0 0 18.88px; object-fit: contain; }
.dropdown-search { height: 40px; padding-left: 14.5px; padding-right: 12px; gap: 8px; }
.dropdown-search img { position: relative; top: 0; left: -2px; width: 18.88px; height: 18.88px; flex: 0 0 18.88px; object-fit: contain; }

/* Auth popup: 20% higher than the centered 257px dialog */
#auth-modal { padding-top: calc(50vh - 205px); }

/* Profile ID value fields */
.profile-id-field { height: 76px; }
.profile-id-field .profile-copy { height: 44px; }
.profile-id-field .profile-copy .copy-default b,
.profile-id-field .profile-copy.copied .copy-success b { font: 600 16px/20px var(--font); }

/* Keep footer separated from the tall profile sidebar even with short main content */
.profile-page { min-height: 940px; margin-bottom: 80px; }

.channel-input-wrap { width: 100%; margin: 0 auto; display: block; }
.channel-input-title { display: block; margin-bottom: 13px; }
.channel-input { width: 100%; height: 48px; padding: 0 16px; color: #fff; background: #05050D; border: 1px solid #1B1B23; border-radius: 10px; font: 400 16px/20px var(--font); outline: 0; transition: background-color .18s ease, border-color .18s ease; }
.channel-input::placeholder { color: var(--text-40); }
.channel-input:focus { background: #05050D; }
.channel-error { margin: 8px 0 0; color: #E62229; text-align: left; font: 400 13px/17px var(--font); }
.submit-channel.is-loading { color: transparent; background: #5087FF; border-color: #5087FF; pointer-events: none; }
.submit-channel.is-loading::after { left: 50%; top: 50%; translate: -50% -50%; }
.submit-channel.is-success, .submit-channel.is-success:hover { width: 240px; color: #fff; background: #2EB822; border-color: #2EB822; }
.submit-channel.is-error, .submit-channel.is-error:hover { width: 240px; color: #fff; background: #E62929; border-color: #E62929; }
.my-channel-state { min-height: 92px; padding: 24px; color: var(--text-75); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font: 400 16px/22px var(--font); }

