/* ec-nav-tiers.css — §NAV-TIERS-2026-10-25 (Owner-Go Phase 6.5)
 *
 * Laedt als LETZTES Stylesheet. Selektoren mit SIEBENfacher Shell-ID: ec-chats-2026.css
 * setzt die Leisten-Knoepfe mit sechs IDs auf display:flex !important — mit fuenf
 * blieb der Tresor-Tab trotz [hidden] sichtbar (im Test nachgemessen).
 *   1. Untere Leiste: Spaltenzahl = sichtbare Tabs (--ecm-tabs, gesetzt von
 *      ecmMeasureNav); [hidden] muss gegen "display:flex !important" gewinnen,
 *      sonst saehe ein Free-Konto den Tresor-Tab.
 *   2. Kontakte als Tab: dasselbe Vollbild-Sheet, endet aber ueber der Leiste
 *      (--ecm-nav-h) und ohne Zurueck-Pfeil.
 *   3. Kontaktzeile: E2EE-Schild nur bei lokalem Nachweis, "Kein @handle".
 *   4. Einstellungen: Hero-Banner (eigenes Titelbild oder lila Wellen + Schild).
 *   5. QR-Dialoge (ec-contact-qr.js).
 *   6. Kontaktanfragen: Sektion ueber den Kontaktlisten + Badges (ec-contact-requests.js).
 */

/* ── 1. Leiste ─────────────────────────────────────────────────────────── */
html body.ec-mobile-shell-active #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-mobile-bottom-nav.ecm-bottom-nav {
  grid-template-columns: repeat(var(--ecm-tabs, 4), minmax(0, 1fr)) !important;
}
html body.ec-mobile-shell-active #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-mobile-bottom-nav.ecm-bottom-nav button[hidden] {
  display: none !important;
}
/* 5 Tabs auf 360 px: Beschriftung darf nicht ueberlaufen. */
html body.ec-mobile-shell-active #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-mobile-bottom-nav.ecm-bottom-nav button {
  min-width: 0 !important;
}
/* Eine Alt-Regel gibt JEDEM Span im Knopf display:grid + width:20px (gedacht fuers Icon);
   die Beschriftung lief bisher nur sichtbar ueber den Rand hinaus. */
html body.ec-mobile-shell-active #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-mobile-bottom-nav.ecm-bottom-nav button > span[data-t] {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  padding: 0 !important;
  letter-spacing: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* ── 2. Kontakte als Tab ───────────────────────────────────────────────── */
html body.ec-mobile-shell-active #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell.ecm-contacts-as-tab .ec-mobile-contacts-sheet {
  bottom: var(--ecm-nav-h, 76px) !important;
  padding-bottom: 10px !important;
}
html body.ec-mobile-shell-active #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell.ecm-contacts-as-tab .ec-mobile-contacts-sheet [data-ecm-contacts-close] {
  display: none !important;
}

/* ── 3. Kontaktzeile ───────────────────────────────────────────────────── */
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell [data-ecm-e2ee-badge][hidden] {
  display: none !important;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ecm-contact-nohandle {
  opacity: .62;
  font-style: italic;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ecm-contact-status[data-ecm-e2ee-text]:empty {
  display: none !important;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ecm-contact-status[data-ecm-e2ee-text]:not(.ecm-e2ee-known) {
  color: var(--ecm-t-dim, rgba(236, 236, 236, .55)) !important;
}

/* ── 4. Einstellungen: Hero-Banner ─────────────────────────────────────── */
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-hero {
  padding-top: 0 !important;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-banner {
  position: absolute;
  top: 0; left: 0; right: 0;          /* innerhalb des Containers — kein Ueberlauf */
  height: 150px;
  border-radius: 20px;
  overflow: hidden;
  isolation: isolate;
  z-index: 0;
  pointer-events: none;
  background-color: #141414;
  background-size: cover;             /* eigenes Titelbild: inline von ec-chat-extras.js */
  background-position: center;
  background-repeat: no-repeat;
}
/* Standard: lila Cyber-Wellen (bg-waves.webp, ins Violett gedreht) + Glow. */
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-banner::before {
  content: '';
  position: absolute; inset: 0;
  z-index: -1;
  background: url('/assets/img/bg-waves.webp') center / cover no-repeat;
  filter: hue-rotate(48deg) saturate(1.45) brightness(1.15);
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-banner::after {
  content: '';
  position: absolute; inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(114, 114, 114, .38), transparent 62%),
    linear-gradient(180deg, rgba(8, 8, 8, 0) 45%, rgba(8, 8, 8, .55) 100%);
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-banner.ec-cover-has::before { display: none; }
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-banner.ec-cover-has::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .45));
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-banner-shield {
  position: absolute;
  top: 14px; left: 16px;              /* links oben: rechts liegt "Profil bearbeiten" */
  width: 48px; height: 48px;
  filter: drop-shadow(0 0 14px rgba(114, 114, 114, .65));
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-banner.ec-cover-has .ec-tg-banner-shield { display: none; }
/* Avatar ragt zur Haelfte in den Banner; Knopf "Profil bearbeiten" liegt darauf. */
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-avatar-wrap {
  margin-top: 96px !important;
  z-index: 1;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-edit-pill {
  top: 10px !important;
  right: 10px !important;
  z-index: 2;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-name,
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-sub {
  position: relative;
  z-index: 1;
}
html body #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-sub.ec-tg-sub-empty {
  opacity: .6;
  font-style: italic;
}

/* ── 5. QR-Dialoge ─────────────────────────────────────────────────────── */
.ec-cqr-modal { display: flex; flex-direction: column; gap: 12px; text-align: center; }
.ec-cqr-modal .ec-cqr-code { display: flex; justify-content: center; }
.ec-cqr-modal .ec-cqr-code canvas { border-radius: 14px; background: #fff; max-width: 100%; height: auto !important; }
.ec-cqr-modal .ec-cqr-handle { font-family: var(--font-mono, monospace); font-size: 16px; font-weight: 700; color: var(--text, #fff); }
.ec-cqr-modal .ec-cqr-text { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text2, rgba(236, 236, 236, .7)); }
.ec-cqr-modal .ec-cqr-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 60vh;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: inset 0 0 0 2px rgba(114, 114, 114, .6);
}
.ec-cqr-modal .ec-cqr-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── 6. Kontaktanfragen (ec-contact-requests.js, §CONTACT-REQUESTS-2026-10-26) ──
   Sektion ueber beiden Kontaktlisten; das Handy-Badge nutzt .ecm-nav-badge der Leiste,
   die Desktop-Leiste bekommt ein eigenes Badge oben rechts am Icon. Handy-Regeln mit
   sieben Shell-IDs (Listen-/Knopf-Regeln der Shell tragen bis zu sechs). */
.ec-creq { margin: 4px 0 12px; }
.ec-creq-title {
  margin: 0 4px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text2, rgba(236, 236, 236, .7));
}
.ec-creq-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 9px;
  background: var(--ecl-pill, #555555);
  color: #fff;
  font-size: 10.5px;
  line-height: 18px;
  text-align: center;
}
.ec-creq-list { display: flex; flex-direction: column; gap: 8px; }
.ec-creq-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--ecl-accent, #727272) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--ecl-accent, #727272) 30%, transparent);
}
.ec-creq-avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #555555, #727272);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}
.ec-creq-copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ec-creq-copy strong, .ec-creq-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-creq-copy strong { color: var(--text, #fff); font-size: 14px; }
.ec-creq-copy small { color: var(--text2, rgba(236, 236, 236, .7)); font-size: 12px; font-family: var(--font-mono, monospace); }
.ec-creq-actions { flex: 0 0 auto; display: flex; gap: 6px; }
.ec-creq-btn {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ec-creq-btn:disabled { opacity: .5; cursor: default; }
.ec-creq-accept { background: var(--ecl-accent, #727272); color: #fff; }
.ec-creq-reject { background: transparent; color: var(--text, #fff); border-color: color-mix(in srgb, var(--text, #fff) 25%, transparent); }
html body.ec-mobile-shell-active #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-creq { display: block !important; padding: 0 12px; }
html body.ec-mobile-shell-active #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-creq-btn {
  min-height: 40px !important;
  min-width: 0 !important;
  width: auto !important;
}
/* Schmale Handys: Knoepfe unter den Namen statt Ellipse auf zwei Buchstaben. */
@media (max-width: 380px) {
  .ec-creq-row { flex-wrap: wrap; }
  .ec-creq-actions { flex: 1 1 100%; }
  .ec-creq-actions .ec-creq-btn { flex: 1 1 0; }
}
/* Desktop-Leiste */
html body #ec-claude-shell-final#ec-claude-shell-final [data-ec-sidebar-action="contacts"] { position: relative; }
html body #ec-claude-shell-final#ec-claude-shell-final .ec-creq-rail-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--ecl-pill, #555555);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}
html body #ec-claude-shell-final#ec-claude-shell-final .ec-creq-rail-badge[hidden] { display: none !important; }
