.sav-realtime-presence {
  align-items: center;
  display: flex;
  isolation: isolate;
  justify-content: center;
  left: var(--sav-presence-left, 50%);
  max-width: var(--sav-presence-max-width, min(180px, calc(100vw - 32px)));
  min-height: 34px;
  pointer-events: none;
  position: fixed;
  top: var(--sav-presence-top, 10px);
  transform: translateX(-50%);
  visibility: hidden;
  width: max-content;
  z-index: 2147482250;
}

.sav-realtime-presence[data-positioned="true"]:not([hidden]) {
  visibility: visible;
}

.sav-realtime-presence[hidden] {
  display: none !important;
}

.sav-realtime-avatar {
  align-items: center;
  background: #e8f0fe;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.18), 0 1px 2px rgba(60, 64, 67, 0.12);
  color: #174ea6;
  display: inline-flex;
  font-family: "Google Sans Flex", "Google Sans", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  height: 32px;
  justify-content: center;
  letter-spacing: 0.02em;
  margin-left: -8px;
  overflow: visible;
  pointer-events: auto;
  position: relative;
  transition:
    box-shadow 140ms ease,
    transform 140ms ease;
  width: 32px;
  z-index: 1;
}

.sav-realtime-avatar:first-child {
  margin-left: 0;
}

.sav-realtime-avatar img {
  background: inherit;
  border-radius: inherit;
  height: calc(100% - 4px);
  inset: 2px;
  object-fit: cover;
  overflow: hidden;
  position: absolute;
  width: calc(100% - 4px);
  z-index: 1;
}

.sav-realtime-avatar:hover,
.sav-realtime-avatar:focus-visible {
  box-shadow: 0 3px 9px rgba(60, 64, 67, 0.28), 0 1px 3px rgba(60, 64, 67, 0.18);
  outline: none;
  transform: translateY(-1px);
  z-index: 20;
}

.sav-realtime-avatar::after {
  background: #303134;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(32, 33, 36, 0.28);
  color: #fff;
  content: attr(data-tooltip);
  font-size: 11px;
  font-weight: 500;
  left: 50%;
  line-height: 1.35;
  max-width: min(260px, calc(100vw - 24px));
  opacity: 0;
  padding: 6px 8px;
  pointer-events: none;
  position: absolute;
  text-align: center;
  top: calc(100% + 8px);
  transform: translate(-50%, -3px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
  visibility: hidden;
  white-space: nowrap;
  width: max-content;
  z-index: 40;
}

.sav-realtime-avatar:hover::after,
.sav-realtime-avatar:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.sav-realtime-presence[data-layout="compact"] {
  min-height: 30px;
}

.sav-realtime-presence[data-layout="compact"] .sav-realtime-avatar {
  font-size: 9px;
  height: 28px;
  width: 28px;
}

.sav-realtime-presence[data-layout="compact"] .sav-realtime-avatar-role {
  bottom: -2px;
  font-size: 6px;
  height: 10px;
  right: -2px;
  width: 10px;
}

.sav-realtime-avatar[data-status="editing"] {
  box-shadow: 0 0 0 2px #34a853, 0 2px 5px rgba(60, 64, 67, 0.24);
}

.sav-realtime-avatar[data-status="away"] {
  filter: saturate(0.68);
}

.sav-realtime-avatar.is-admin {
  background: #fef7e0;
  color: #b06000;
}

.sav-realtime-avatar-role {
  align-items: center;
  background: #f9ab00;
  border: 1px solid #fff;
  border-radius: 999px;
  bottom: -3px;
  color: #fff;
  display: inline-flex;
  font-size: 7px;
  height: 12px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: -3px;
  width: 12px;
  z-index: 2;
}

.sav-realtime-avatar-count {
  background: #f1f3f4;
  color: #3c4043;
}

.sav-access-login-active .sav-realtime-presence,
.sav-maintenance-active .sav-realtime-presence {
  display: none !important;
}

@media print {
  .sav-realtime-presence {
    display: none !important;
  }
}

.sav-realtime-conflict-backdrop {
  align-items: center;
  background: rgba(32, 33, 36, 0.48);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 2147483200;
}

.sav-realtime-conflict-dialog {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(60, 64, 67, 0.3);
  color: #202124;
  font-family: "Google Sans Flex", "Google Sans", Arial, sans-serif;
  max-height: min(720px, calc(100vh - 48px));
  max-width: 680px;
  overflow: auto;
  padding: 28px;
  width: min(100%, 680px);
}

.sav-realtime-conflict-eyebrow {
  color: #c5221f;
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.sav-realtime-conflict-dialog h2 {
  font-size: 22px;
  line-height: 1.25;
  margin: 0 0 8px;
}

.sav-realtime-conflict-dialog > p {
  color: #5f6368;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 20px;
}

.sav-realtime-conflict-fields {
  display: grid;
  gap: 12px;
}

.sav-realtime-conflict-field {
  border: 1px solid #dadce0;
  border-radius: 12px;
  padding: 14px;
}

.sav-realtime-conflict-field > strong {
  display: block;
  font-size: 13px;
  margin-bottom: 10px;
}

.sav-realtime-conflict-comparison {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sav-realtime-conflict-comparison > span {
  background: #f8fafd;
  border-radius: 9px;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
}

.sav-realtime-conflict-comparison small {
  color: #5f6368;
  font-size: 10px;
  text-transform: uppercase;
}

.sav-realtime-conflict-comparison b {
  font-size: 13px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.sav-realtime-conflict-dialog footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}

.sav-realtime-conflict-dialog button {
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  min-height: 38px;
  padding: 8px 16px;
}

.sav-realtime-conflict-shared {
  background: #fff;
  border: 1px solid #dadce0;
  color: #3c4043;
}

.sav-realtime-conflict-mine {
  background: #1a73e8;
  border: 1px solid #1a73e8;
  color: #fff;
}

.sav-realtime-conflict-dialog button:hover {
  box-shadow: 0 2px 6px rgba(60, 64, 67, 0.22);
}

.sav-realtime-conflict-dialog button:focus-visible {
  outline: 3px solid rgba(26, 115, 232, 0.3);
  outline-offset: 2px;
}

@media (max-width: 820px) {
  .sav-realtime-presence {
    min-height: 30px;
  }

  .sav-realtime-avatar {
    font-size: 9px;
    height: 28px;
    width: 28px;
  }

  .sav-realtime-conflict-comparison {
    grid-template-columns: 1fr;
  }

  .sav-realtime-conflict-dialog footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }
}

@media (max-width: 520px) {
  .sav-realtime-conflict-backdrop {
    align-items: flex-end;
    padding: 10px;
  }

  .sav-realtime-conflict-dialog {
    border-radius: 18px;
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sav-realtime-presence,
  .sav-realtime-avatar,
  .sav-realtime-avatar::after {
    transition: none !important;
  }
}
