.sync-security-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.sync-e2ee-badge {
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(21, 128, 61, .28);
  border-radius: 15px;
  background: linear-gradient(145deg, #ecfdf5 0%, #dcfce7 100%);
  color: #15803d;
  box-shadow: 0 8px 20px rgba(22, 101, 52, .11), inset 0 1px 0 rgba(255, 255, 255, .92);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.sync-e2ee-badge:hover {
  transform: translateY(-1px);
  border-color: rgba(21, 128, 61, .48);
  box-shadow: 0 11px 24px rgba(22, 101, 52, .15), inset 0 1px 0 rgba(255, 255, 255, .95);
}

.sync-e2ee-badge:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(34, 197, 94, .24),
    0 8px 20px rgba(22, 101, 52, .11),
    inset 0 1px 0 rgba(255, 255, 255, .92);
}

.sync-e2ee-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 80;
  top: calc(100% + 9px);
  right: 0;
  width: max-content;
  max-width: min(260px, 78vw);
  padding: 8px 10px;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  white-space: normal;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity .15s ease, transform .15s ease;
}

.sync-e2ee-badge:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.sync-e2ee-badge[aria-expanded="true"]::after {
  opacity: 0;
  transform: translateY(-3px);
}

.sync-e2ee-badge svg {
  width: 29px;
  height: 29px;
  display: block;
}

body.sync-e2ee-modal-open {
  overflow: hidden;
}

.sync-e2ee-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .14s ease, visibility 0s linear .14s;
}

.sync-e2ee-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.sync-e2ee-modal-card {
  position: relative;
  width: min(100%, 520px);
  max-height: min(760px, calc(100vh - 28px));
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(21, 128, 61, .2);
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 2%, rgba(34, 197, 94, .13), transparent 31%),
    linear-gradient(150deg, #fff 0%, #f7fff9 100%);
  color: #111827;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .28);
  opacity: 0;
  transform: translateY(7px) scale(.99);
  transition: opacity .14s ease, transform .14s ease;
}

.sync-e2ee-modal.is-open .sync-e2ee-modal-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.sync-e2ee-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid #dbe5de;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  color: #475569;
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}

.sync-e2ee-modal-icon {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin-bottom: 18px;
  border: 1px solid rgba(21, 128, 61, .18);
  border-radius: 24px;
  background: rgba(236, 253, 245, .94);
  box-shadow: 0 14px 32px rgba(22, 101, 52, .11);
}

.sync-e2ee-modal-icon svg {
  width: 52px;
  height: 52px;
}

.sync-e2ee-modal-eyebrow {
  margin-bottom: 7px;
  color: #15803d;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sync-e2ee-modal-card h2 {
  margin: 0;
  color: #111827;
  font-size: clamp(24px, 5vw, 30px);
  font-weight: 680;
  line-height: 1.16;
  letter-spacing: -.025em;
}

.sync-e2ee-modal-lead {
  margin: 13px 0 0;
  color: #475569;
  font-size: 15px;
  line-height: 1.65;
}

.sync-e2ee-modal-points {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.sync-e2ee-modal-point {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 12px 13px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: rgba(255, 255, 255, .76);
}

.sync-e2ee-modal-point-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: #dcfce7;
  color: #15803d;
  font-size: 15px;
  font-weight: 800;
}

.sync-e2ee-modal-point strong {
  display: block;
  color: #1f2937;
  font-size: 14px;
  font-weight: 680;
  line-height: 1.35;
}

.sync-e2ee-modal-point > div > span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.sync-e2ee-modal-meta {
  margin: 16px 0 0;
  padding: 11px 13px;
  border-radius: 14px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.sync-e2ee-modal-action {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  border-radius: 15px;
  background: #166534;
  color: #fff;
  font-weight: 680;
}

.sync-e2ee-modal-action:hover {
  background: #14532d;
}

body[data-sync-theme="midnight"] .sync-e2ee-badge {
  border-color: rgba(74, 222, 128, .28);
  background: linear-gradient(145deg, #102a25, #12382d);
  color: #86efac;
  box-shadow: 0 9px 22px rgba(0, 0, 0, .18);
}

body[data-sync-theme="midnight"] .sync-e2ee-modal-card {
  border-color: rgba(74, 222, 128, .2);
  background:
    radial-gradient(circle at 88% 2%, rgba(34, 197, 94, .16), transparent 31%),
    linear-gradient(150deg, #101b2c 0%, #0d211d 100%);
  color: #e5edf7;
}

body[data-sync-theme="midnight"] .sync-e2ee-modal-card h2,
body[data-sync-theme="midnight"] .sync-e2ee-modal-point strong {
  color: #e5edf7;
}

body[data-sync-theme="midnight"] .sync-e2ee-modal-lead,
body[data-sync-theme="midnight"] .sync-e2ee-modal-point > div > span {
  color: #aebdd0;
}

body[data-sync-theme="midnight"] .sync-e2ee-modal-point,
body[data-sync-theme="midnight"] .sync-e2ee-modal-close {
  border-color: #304158;
  background: rgba(11, 22, 39, .76);
}

body[data-sync-theme="midnight"] .sync-e2ee-modal-meta {
  background: #0b1627;
  color: #aebdd0;
}

@media (max-width: 520px) {
  .sync-security-actions {
    gap: 7px;
  }

  .sync-e2ee-badge {
    flex-basis: 40px;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    border-radius: 13px;
  }

  .sync-e2ee-badge svg {
    width: 27px;
    height: 27px;
  }

  .sync-e2ee-modal {
    padding: 12px;
  }

  .sync-e2ee-modal-card {
    padding: 22px 18px 18px;
    border-radius: 22px;
  }

  .sync-e2ee-modal-icon {
    width: 62px;
    height: 62px;
    border-radius: 20px;
  }

  .sync-e2ee-modal-icon svg {
    width: 44px;
    height: 44px;
  }
}
