/* §SETTINGS-TG-2026-09-23 — Einstellungen im Telegram-Stil (Mobile-Shell).
 *
 * Spezifität: mobile-overrides.css eskaliert über die dreifach wiederholte
 * #ec-mobile-shell-ID; hier deshalb vierfach (siehe mobile-audit-fixes.css),
 * sonst gewinnen die generischen Button-/Grid-Regeln der Shell.
 * Muss als letztes Stylesheet laden.
 */
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-settings {
  --tg-card: rgba(255, 255, 255, .055);
  --tg-card-press: rgba(255, 255, 255, .09);
  --tg-sep: rgba(255, 255, 255, .075);
  --tg-text: var(--text, #f5f5f7);
  --tg-sub: var(--text2, rgba(235, 235, 245, .58));
  --tg-accent: var(--accent, #717171);
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 4px 16px calc(28px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  color: var(--tg-text);
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-settings[hidden] { display: none; }

/* ── Profil-Header ─────────────────────────────────────────────────────── */
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 0 2px;
  min-width: 0;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-edit-pill {
  position: absolute;
  top: 0;
  right: 0;
  min-height: 34px;
  width: auto;
  margin: 0;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(20, 20, 28, .72);
  color: var(--tg-text);
  font-weight: 600; font-size: 13px; line-height: 1; font-family: inherit;
  letter-spacing: 0;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-edit-pill:active { background: rgba(41, 41, 41, .9); }

html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-avatar-wrap {
  position: relative;
  display: block;
  width: 108px;
  height: 108px;
  min-height: 0;
  margin: 26px 0 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-avatar {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, var(--tg-accent), #7b7b7b);
  color: #fff;
  font-weight: 700; font-size: 38px; line-height: 1; font-family: inherit;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-avatar.ec-av-has .ec-tg-initials { visibility: hidden; }
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-avatar.ec-av-busy::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  animation: ec-tg-pulse 1s ease-in-out infinite alternate;
}
@keyframes ec-tg-pulse { from { opacity: .35; } to { opacity: .8; } }
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-cam {
  position: absolute;
  right: 0;
  bottom: 2px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tg-accent);
  color: #fff;
  border: 3px solid var(--bg, #000);
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-cam svg { width: 17px; height: 17px; }

html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-name {
  margin: 0;
  max-width: 100%;
  font-weight: 700; font-size: 22px; line-height: 1.25; font-family: inherit;
  letter-spacing: -.01em;
  color: var(--tg-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-sub {
  margin: 4px 0 0;
  max-width: 100%;
  font-weight: 400; font-size: 15px; line-height: 1.3; font-family: inherit;
  color: var(--tg-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Gruppen & Karten ──────────────────────────────────────────────────── */
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-group { min-width: 0; margin: 0; }
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-group-title {
  margin: 0 0 7px 16px;
  font-weight: 500; font-size: 13px; line-height: 1.2; font-family: inherit;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--tg-sub);
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 14px;
  background: var(--tg-card);
  overflow: hidden;
  border: 0;
  box-shadow: none;
}

html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  margin: 0;
  padding: 9px 14px 9px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--tg-text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform: none;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-row:active { background: var(--tg-card-press); }
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-row:focus-visible { outline: 2px solid var(--tg-accent); outline-offset: -2px; }
/* Trennlinie wie bei Telegram: beginnt erst hinter der Icon-Kachel. */
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-row + .ec-tg-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 60px;
  right: 0;
  height: 1px;
  background: var(--tg-sep);
  transform: scaleY(.5);
  transform-origin: top;
  pointer-events: none;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-ico {
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--tg, #727272);
  color: #fff;
  box-shadow: none;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-ico svg { width: 19px; height: 19px; }
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-txt {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-txt strong {
  font-weight: 500; font-size: 16px; line-height: 1.25; font-family: inherit;
  color: var(--tg-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-txt small {
  font-weight: 400; font-size: 13px; line-height: 1.25; font-family: inherit;
  color: var(--tg-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-val {
  flex: 0 1 auto;
  max-width: 42%;
  font-weight: 400; font-size: 15px; line-height: 1.2; font-family: inherit;
  color: var(--tg-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-chev {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  color: var(--tg-sub);
  opacity: .7;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-logout .ec-tg-txt strong { color: #ff6b6b; }

/* ── Gefahrenzone (Cyber-Red) ──────────────────────────────────────────── */
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-danger { margin: 0; min-width: 0; }
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-danger .ec-tg-group-title { color: #ff2d55; }
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-danger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 45, 85, .55);
  background: linear-gradient(180deg, rgba(255, 45, 85, .16), rgba(255, 45, 85, .08));
  box-shadow: 0 0 0 1px rgba(255, 45, 85, .08), 0 0 22px rgba(255, 45, 85, .12);
  color: #ff5c7a;
  font-weight: 700; font-size: 15px; line-height: 1.25; font-family: inherit;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-danger-btn:active { background: rgba(255, 45, 85, .24); }
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-danger-btn svg { flex: 0 0 18px; width: 18px; height: 18px; }
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-danger p {
  margin: 8px 16px 0;
  font-weight: 400; font-size: 12.5px; line-height: 1.35; font-family: inherit;
  color: var(--tg-sub);
}

/* Helle Themes: Karten dunkel statt weiß-transparent. */
html body[data-ec-mobile-theme="titanium-steel"] #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-settings {
  --tg-card: rgba(255, 255, 255, .07);
}

/* ── Desktop-Einstellungen: Avatar ist jetzt der Upload-Auslöser ─────── */
.ec-settings-avatar { position: relative; cursor: pointer; }
.ec-settings-avatar::after {
  content: '📷';
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent, #717171);
  border: 2px solid var(--bg, #000);
  font-size: 13px;
  line-height: 1;
}
.ec-settings-avatar.ec-av-has { overflow: visible !important; }
.ec-settings-avatar.ec-av-has > img.ec-av-img { border-radius: 50%; }
.ecf-avatar-card .ec-av-edit-orb { position: relative; cursor: pointer; overflow: visible !important; }
.ecf-avatar-card .ec-av-edit-orb > img.ec-av-img { border-radius: 50%; }
.ecf-avatar-card .ec-av-edit-orb::after {
  content: '📷';
  position: absolute;
  right: -4px;
  bottom: -4px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent, #717171);
  border: 2px solid var(--bg, #000);
  font-size: 13px;
  line-height: 1;
}
.ecf-avatar-card .ec-av-edit-orb:focus-visible { outline: 2px solid var(--accent, #717171); outline-offset: 3px; }
