.avatar-face {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid #ffffff39;
  border-radius: inherit;
  background: linear-gradient(145deg, #43434d, #212128 75%);
  color: #fff;
  font: 650 21px/1 var(--font);
}
.avatar-face img { width: 100%; height: 100%; object-fit: cover; }
.avatar-face [hidden], .avatar-dialog [hidden] { display: none; }
.avatar-edit {
  position: relative;
  display: block;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: 0 0 0 3px #1a1a1a;
  cursor: pointer;
}
.avatar-pencil {
  position: absolute;
  bottom: -3px;
  right: -4px;
  width: 16px;
  height: 16px;
  padding: 2px;
  border: 1px solid #ffffff50;
  border-radius: 50%;
  background: #303036;
  color: white;
}
.avatar-edit:hover .avatar-pencil { background: #505058; }
.avatar-edit:focus-visible, .avatar-dialog button:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}
.avatar-dialog {
  box-sizing: border-box;
  width: min(368px, calc(100% - 32px));
  margin: auto;
  padding: 20px;
  border: 1px solid #ffffff32;
  border-radius: 18px;
  background: #202026;
  color: #f7f7fa;
  box-shadow: 0 16px 60px #0007;
  font-family: var(--font);
}
.avatar-dialog::backdrop { background: #0c0c128c; }
.avatar-dialog-head, .avatar-settings { display: flex; align-items: center; gap: 14px; }
.avatar-dialog-head { justify-content: space-between; margin: 0 0 18px; }
.avatar-dialog-head h2 { margin: 0; font: 650 20px/1.18 var(--font); }
.avatar-dialog button { font: 600 13px/1.25 var(--font); cursor: pointer; }
.avatar-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: #ffffff0f;
  color: inherit;
}
.avatar-close svg { width: 16px; height: 16px; }
.avatar-settings .avatar-face { flex: 0 0 60px; height: 60px; border-radius: 14px; font-size: 29px; }
.avatar-upload { padding: 9px 13px; border: 0; border-radius: 8px; background: #efeff3; color: #151518; }
.avatar-upload:hover { background: white; }
.avatar-settings p, .avatar-feedback { margin: 7px 0 0; font: 450 12px/1.45 var(--font); color: #c3c3ca; }
.avatar-reset {
  margin: 14px 0 0;
  padding: 5px 10px;
  border: 1px solid #ff6b6b59;
  border-radius: 7px;
  background: #ff4d4d1a;
  color: #ff8a8a;
  font: 600 12px/1.25 var(--font);
  cursor: pointer;
}
.avatar-reset:hover { border-color: #ff6b6b8c; background: #ff4d4d2e; color: #ffb3b3; }
.avatar-reset:disabled { opacity: .5; cursor: default; }
.avatar-feedback:not(:empty) { margin-top: 12px; }
.avatar-feedback:empty { margin: 0; }
.tg-link-dialog { width: min(400px, calc(100% - 32px)); }
.tg-link-dialog p { margin: 0 0 10px; font: 450 12px/1.5 var(--font); color: #c3c3ca; }
.tg-link-dialog .tg-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 14px;
  padding: 9px 13px;
  border-radius: 8px;
  background: #efeff3;
  color: #151518;
  font: 600 13px/1.25 var(--font);
  text-decoration: none;
}
.tg-link-dialog .tg-open:hover { background: #fff; }
.tg-code-row { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.tg-code-row code {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #ffffff26;
  border-radius: 8px;
  background: #ffffff0a;
  color: #ececf1;
  font: 600 12px/1.3 var(--mono);
  overflow-wrap: anywhere;
}
.tg-copy { flex: 0 0 auto; padding: 9px 11px; border: 1px solid #ffffff2b; border-radius: 8px; background: #ffffff12; color: #f2f2f6; }
.tg-copy:hover { background: #ffffff1f; }
.tg-status { min-height: 16px; margin: 0; color: #9be9b8; }
