/* Avatars, presence and availability in cards, the settings avatar block. */
.avatar {
  width: 36px; height: 36px; min-width: 36px; min-height: 36px; max-width: 36px; max-height: 36px;
  aspect-ratio: 1 / 1; border-radius: 50%; color: #fff;
  font-weight: 700; font-size: 14px; position: relative; flex: 0 0 36px; align-self: flex-start;
  user-select: none; overflow: visible; display: block;
  background-color: var(--avatar-bg, #7939f2);
}
.avatar img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: center; display: block;
  border-radius: inherit;
}
.avatar .presence {
  position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%;
  background: #3db887; border: 1px solid #fff; z-index: 2; box-sizing: border-box;
  pointer-events: none;
}
.avatar .presence::before,
.avatar .presence::after { content: none !important; display: none !important; }
.avatar .presence.away { background: #f5a623; }
.avatar .presence.dnd { background: #d24b4e; }
.avatar .presence.offline { background: #a0a4b0; border-color: #fff; }
.av-0 { background: var(--accent); } .nc-0 { color: var(--accent); }
.av-1 { background: #3db887; } .nc-1 { color: #1c8f68; }
.av-2 { background: #d24b4e; } .nc-2 { color: #d24b4e; }
.av-3 { background: #e0941a; } .nc-3 { color: #b67408; }
.av-4 { background: #8f4fbf; } .nc-4 { color: #8f4fbf; }
.av-5 { background: #1f9aaf; } .nc-5 { color: #1f9aaf; }
.av-6 { background: #e05a8a; } .nc-6 { color: #e05a8a; }
.av-7 { background: #5b6ee1; } .nc-7 { color: #5b6ee1; }

.typing { display: none; }
.profile-visit {
  flex: 1; overflow: auto; display: flex; flex-direction: column; align-items: stretch;
  padding: 16px 20px 24px; gap: 4px; min-height: 0;
}
.profile-visit > * { flex-shrink: 0; }
.card-avatar-wrap {
  position: relative;
  width: 140px; height: 140px;
  min-width: 140px; min-height: 140px;
  max-width: 140px; max-height: 140px;
  margin: 4px auto 16px;
  align-self: center;
  flex: 0 0 140px;
  overflow: visible;
}
.profile-visit .avatar {
  position: absolute; inset: 0;
  width: 100% !important; height: 100% !important;
  min-width: 0 !important; min-height: 0 !important;
  max-width: none !important; max-height: none !important;
  aspect-ratio: auto; border-radius: 8px; font-size: 48px; margin: 0;
  cursor: pointer; flex: none !important; overflow: visible; display: block;
  align-self: auto;
}
.profile-visit .avatar img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  border-radius: 8px; display: block;
}
.avatar-clear {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 24px; height: 24px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.92); color: #8b8e98; font-size: 16px; line-height: 1;
  display: grid; place-items: center; cursor: pointer; padding: 0;
  box-shadow: 0 1px 4px rgba(20,28,45,.18);
}
.avatar-clear:hover { color: #5c6270; background: #fff; }
.avatar-clear.hidden { display: none !important; }
.profile-visit .avatar .presence {
  right: 4px; bottom: 4px; width: 18px; height: 18px; border-width: 1.5px;
}
.visit-name {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  width: 100%; position: relative; z-index: 1;
}
.visit-name input {
  flex: 1; min-width: 0; font-size: 22px; font-weight: 700; color: var(--text-strong);
  border: none; border-bottom: 2px solid #d5d8de; border-radius: 0; padding: 0 0 2px; background: transparent;
}
.profile-visit h2 { margin: 0; font-size: 22px; line-height: 1.25; flex: 1; }
.visit-edit {
  width: 32px; height: 32px; border: none; border-radius: 4px; background: none;
  color: var(--accent); display: grid; place-items: center; flex: none; padding: 0;
}
.visit-edit:hover { background: var(--accent-soft); }
.profile-visit #card-role { font-size: 15px; margin-top: 4px; }
.profile-visit #card-handle { color: #6b7080; font-size: 14px; }

.card-presence {
  margin-top: 6px; color: #6b7080; font-size: 14px; line-height: 1.3;
}
.card-presence:empty { display: none; }
.card-presence.is-online { color: #2f9e6b; font-weight: 600; }
.card-contact.hidden { display: none !important; }
.card-contact-ico {
  width: 22px; height: 22px; border-radius: 0; background: transparent;
  color: #1b1d21; display: grid; place-items: center; flex: none;
}
.card-contact-ico svg { display: block; width: 20px; height: 20px; }
.profile-visit.is-other .card-availability { display: none !important; }
.card-availability {
  margin-top: 10px;
  border: var(--glass-border);
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--glass-chip-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
}
.card-availability #card-availability-toggle {
  height: 52px;
  min-height: 52px;
  color: #1b1d21;
  font-size: 15px;
  font-weight: 700;
  box-sizing: border-box;
}
.card-availability .user-menu-row { border-top: none; }
.card-availability .availability-list { display: block; }
.card-availability .availability-list.hidden { display: none !important; }
.card-availability .availability-list .user-menu-row {
  border-top: 1px solid #f0f0f0; padding-left: 16px; flex: 0 0 auto; min-height: 44px;
}
.profile-visit #card-status { margin: 8px 0 0; color: #3f4350; font-size: 14px; }
.profile-visit #card-status:empty { display: none; }
.settings-screen {
  position: absolute; inset: 0; z-index: 6; background: #fff; overflow: auto;
  display: flex; justify-content: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 20px calc(48px + var(--sab));
  box-sizing: border-box;
}
.settings-card { width: min(480px, 100%); padding-bottom: 16px; }
.settings-card:has([data-panel="accounts"]:not(.hidden)) { width: min(760px, 100%); }
.settings-card:has([data-panel="apps"]:not(.hidden)) { width: min(980px, 100%); }
.settings-menu { display: none; }
.settings-card h1 { margin: 0 0 8px; font-size: calc(24px * var(--text-scale, 1)); }
.settings-avatar-block {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 8px 0 22px;
}
.settings-avatar-wrap {
  position: relative;
  width: 152px;
  height: 152px;
  min-width: 152px;
  min-height: 152px;
  flex: 0 0 152px;
}
.settings-avatar-wrap .avatar {
  width: 152px !important;
  height: 152px !important;
  min-width: 152px !important;
  min-height: 152px !important;
  max-width: 152px !important;
  max-height: 152px !important;
  flex: 0 0 152px !important;
  font-size: 56px;
  border-radius: 14px;
  overflow: hidden;
  align-self: center;
}
.settings-avatar-wrap .avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
.settings-avatar-wrap .avatar .presence {
  width: 18px;
  height: 18px;
  right: 4px;
  bottom: 4px;
  border-width: 2px;
}
.settings-avatar-edit {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--accent);
  background: rgba(255,255,255,.94);
  box-shadow: 0 1px 4px rgba(20,28,45,.18);
  cursor: pointer;
}
.settings-avatar-edit:hover {
  background: #fff;
}
.settings-avatar-edit svg {
  display: block;
}
.settings-avatar-wrap .avatar-clear {
  top: auto;
  bottom: 6px;
  right: 6px;
  z-index: 3;
}
.settings-panel-head {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 8px;
}
.settings-panel-head > h1 { margin-bottom: 8px; }
.settings-panel-sub {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.settings-panel-head .settings-lead { margin-bottom: 0; min-width: 0; flex: 1; }
