/* e2ee.css — lock strip in chats + the encryption bottom sheets (see e2ee.js) */

/* slim "End-to-end encrypted" bar under the chat header */
.e2ee-strip {
  align-items: center; background: rgba(31,158,120,.09); border: 0; border-bottom: 1px solid rgba(31,158,120,.16);
  color: #1b7f61; cursor: pointer; display: flex; flex: 0 0 auto; font: inherit; font-size: 11px; font-weight: 700;
  gap: 6px; justify-content: center; letter-spacing: .01em; padding: 6px 12px; width: 100%;
}
.e2ee-strip svg { fill: none; height: 12px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; width: 12px; }
.e2ee-strip .e2ee-strip-chev { opacity: .6; height: 10px; width: 10px; }
.e2ee-strip:active { background: rgba(31,158,120,.16); }
body[data-theme="dark"] .e2ee-strip { background: rgba(52,211,153,.08); border-bottom-color: rgba(52,211,153,.14); color: #5fd8ae; }

/* small lock beside the contact name in the header */
.thread-head-name-row .e2ee-name-lock { color: #1f9e78; display: inline-flex; margin-left: 5px; vertical-align: -1px; }
.thread-head-name-row .e2ee-name-lock svg { fill: none; height: 12px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.4; width: 12px; }

/* empty-state encrypted note */
.e2ee-empty-note { align-items: center; color: #1b7f61; display: inline-flex; font-size: 11px; font-weight: 700; gap: 5px; margin-top: 4px; }
.e2ee-empty-note svg { fill: none; height: 12px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; width: 12px; }
body[data-theme="dark"] .e2ee-empty-note { color: #5fd8ae; }

/* bottom sheet */
.e2ee-layer {
  align-items: flex-end; background: rgba(8,10,18,0); display: flex; inset: 0; justify-content: center;
  position: fixed; transition: background .22s ease; z-index: 3000;
}
.e2ee-layer.open { background: rgba(8,10,18,.55); }
.e2ee-sheet {
  background: #fff; border-radius: 22px 22px 0 0; box-shadow: 0 -18px 50px rgba(0,0,0,.25); color: #1c233d;
  max-height: 92vh; max-width: 480px; overflow-y: auto; padding: 22px 20px calc(18px + env(safe-area-inset-bottom));
  text-align: center; transform: translateY(24px); transition: transform .26s cubic-bezier(.2,.8,.2,1); width: 100%;
}
.e2ee-layer.open .e2ee-sheet { transform: translateY(0); }
body[data-theme="dark"] .e2ee-sheet { background: #161b22; color: #e6edf3; border: 1px solid rgba(255,255,255,.08); border-bottom: 0; }
.e2ee-hero {
  align-items: center; background: linear-gradient(135deg, #d9f7ec, #bfeedd); border-radius: 18px; color: #17896a; display: inline-flex;
  height: 56px; justify-content: center; margin-bottom: 10px; width: 56px; box-shadow: 0 8px 20px rgba(31,158,120,.22);
}
.e2ee-hero.warn { background: linear-gradient(135deg, #ffefd0, #ffdca0); color: #b8740a; box-shadow: 0 8px 20px rgba(201,138,10,.22); }
.e2ee-hero svg { fill: none; height: 26px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 26px; }
body[data-theme="dark"] .e2ee-hero { background: rgba(52,211,153,.14); color: #5fd8ae; box-shadow: none; }
body[data-theme="dark"] .e2ee-hero.warn { background: rgba(245,170,50,.15); color: #f5b43c; }
.e2ee-sheet h3 { font-size: 17px; letter-spacing: -.02em; margin: 0 0 8px; }
.e2ee-text { color: #5b647c; font-size: 12.5px; line-height: 1.6; margin: 0 0 14px; }
body[data-theme="dark"] .e2ee-text { color: #9aa4b8; }
.e2ee-fine { color: #8089a0; font-size: 11px; line-height: 1.55; margin: 0 0 14px; }
.e2ee-hint { color: #8089a0; font-size: 11px; line-height: 1.55; margin: 10px 0 0; }
.e2ee-code-block { background: #f4f6fb; border: 1px solid #e6e9f0; border-radius: 16px; margin-bottom: 12px; padding: 12px; }
body[data-theme="dark"] .e2ee-code-block { background: #0d1117; border-color: rgba(255,255,255,.08); }
.e2ee-code-title { color: #8089a0; display: block; font-size: 10px; font-weight: 800; letter-spacing: .12em; margin-bottom: 8px; text-transform: uppercase; }
.e2ee-code { display: grid; gap: 8px 6px; grid-template-columns: repeat(4, 1fr); }
.e2ee-code span { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.e2ee-code .e2ee-code-loading { color: #8089a0; font-family: inherit; font-size: 11.5px; font-weight: 600; grid-column: 1 / -1; letter-spacing: 0; }
.e2ee-row {
  align-items: center; border: 1px solid #e6e9f0; border-radius: 14px; display: flex; gap: 10px; justify-content: space-between;
  margin-bottom: 12px; padding: 10px 12px; text-align: left;
}
body[data-theme="dark"] .e2ee-row { border-color: rgba(255,255,255,.1); }
.e2ee-row span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.e2ee-row strong { font-size: 12.5px; }
.e2ee-row small { color: #8089a0; font-size: 10.5px; line-height: 1.4; }
.e2ee-mini { background: #eae5ff; border: 0; border-radius: 999px; color: #5b49cf; cursor: pointer; flex: 0 0 auto; font: inherit; font-size: 11.5px; font-weight: 800; padding: 7px 14px; }
body[data-theme="dark"] .e2ee-mini { background: rgba(139,123,255,.2); color: #c3b9ff; }

/* inputs — 16px so iOS Safari doesn't zoom the page on focus */
.e2ee-input {
  background: #f4f6fb; border: 1.5px solid #e6e9f0; border-radius: 12px; box-sizing: border-box; color: inherit; display: block;
  font: inherit; font-size: 16px; margin-bottom: 10px; padding: 12px 14px; touch-action: manipulation; width: 100%;
}
.e2ee-input:focus { border-color: #8b7bff; outline: none; }
body[data-theme="dark"] .e2ee-input { background: #0d1117; border-color: rgba(255,255,255,.12); }
.e2ee-error { color: #d8465a; font-size: 11.5px; font-weight: 600; margin: 0 0 8px; min-height: 0; }
.e2ee-error:empty { display: none; }
.e2ee-btn { border: 0; border-radius: 14px; cursor: pointer; display: block; font: inherit; font-size: 13.5px; font-weight: 800; margin-top: 8px; padding: 13px 16px; width: 100%; }
.e2ee-btn.primary { background: linear-gradient(135deg, #7868e9, #8b7bff); box-shadow: 0 10px 22px rgba(120,104,233,.32); color: #fff; }
.e2ee-btn.primary:disabled { opacity: .6; }
.e2ee-btn.ghost { background: transparent; color: #7d859a; }
.e2ee-btn.danger { background: #fde9ec; color: #c8344a; }
.e2ee-btn.danger-link { background: transparent; color: #c8344a; font-size: 12px; }
body[data-theme="dark"] .e2ee-btn.danger { background: rgba(216,70,90,.16); color: #ff8a9a; }
body[data-theme="dark"] .e2ee-btn.danger-link { color: #ff8a9a; }

@media (min-width: 700px) {
  .e2ee-layer { align-items: center; }
  .e2ee-sheet { border-radius: 22px; }
}
