.sl-notification-popover,
.sl-message-window {
  position: fixed;
  z-index: 1060;
  display: flex;
  flex-direction: column;
  border: 1px solid #dfe6ed;
  background: #fff;
  color: #334155;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(.99);
  transition: opacity .14s ease, transform .14s ease;
}

.sl-notification-popover[hidden],
.sl-message-window[hidden] { display: none; }

.sl-notification-popover.is-open,
.sl-message-window.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.sl-notification-popover {
  width: min(420px, calc(100vw - 24px));
  max-height: min(600px, calc(100dvh - 76px));
  border-radius: 12px;
  transform-origin: top right;
}

.sl-notification-popover::before,
.sl-notification-popover::after {
  position: absolute;
  right: var(--sl-popover-arrow-right, 20px);
  width: 0;
  height: 0;
  border-right: 8px solid transparent;
  border-left: 8px solid transparent;
  content: "";
}

.sl-notification-popover::before {
  top: -9px;
  border-bottom: 9px solid #dfe6ed;
}

.sl-notification-popover::after {
  top: -8px;
  border-bottom: 9px solid #fff;
}

.sl-message-window {
  top: 68px;
  right: 16px;
  width: min(760px, calc(100vw - 32px));
  height: min(720px, calc(100dvh - 84px));
  border-radius: 12px;
  transform-origin: top right;
}

.sl-communication-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 10px 12px;
  border-bottom: 1px solid #e8edf2;
  background: #fff;
}

.sl-notification-popover .sl-communication-head { border-radius: 12px 12px 0 0; }
.sl-message-window .sl-communication-head { border-radius: 12px 12px 0 0; }

.sl-communication-heading,
.sl-communication-actions {
  display: flex;
  align-items: center;
}

.sl-communication-heading {
  min-width: 0;
  gap: 9px;
}

.sl-communication-heading > div { min-width: 0; }

.sl-communication-title-icon {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: #eefbf3;
  color: #078a47;
  font-size: .95rem;
}

.sl-communication-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  font-weight: 650;
  line-height: 22px;
}

[data-communication-state] {
  display: block;
  min-height: 15px;
  color: #64748b;
  font-size: 11px;
  line-height: 15px;
}

.sl-communication-actions { gap: 3px; }

.sl-communication-actions button {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
}

.sl-communication-actions button:hover,
.sl-communication-actions button:focus-visible {
  background: #f1f5f9;
  color: #0f172a;
}

.sl-communication-actions button:focus-visible {
  outline: 2px solid rgba(7, 193, 96, .28);
  outline-offset: 1px;
}

.sl-communication-body {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  padding: 0;
  overflow: hidden;
  border-radius: 0 0 12px 12px;
  background: #f8fafc;
}

.sl-communication-loading,
.sl-communication-error,
.sl-communication-empty {
  display: flex;
  flex: 1;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 28px;
  color: #64748b;
  text-align: center;
}

.sl-communication-error i,
.sl-communication-empty i {
  color: #94a3b8;
  font-size: 1.55rem;
}

.sl-communication-error p,
.sl-communication-empty p { margin: 0; }

.sl-communication-retry {
  border: 0;
  background: transparent;
  color: #078a47;
  font-weight: 600;
}

.sl-communication-confirm {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .28);
}

.sl-communication-confirm-card {
  width: min(360px, 100%);
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(15, 23, 42, .18);
}

.sl-communication-confirm-card strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 650;
}

.sl-communication-confirm-card p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 20px;
}

.sl-communication-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.sl-notification-panel {
  width: 100%;
  min-height: 100%;
  overflow-y: auto;
  background: #fff;
}

.sl-notification-toolbar {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid #e8edf2;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
}

.sl-notification-toolbar > div {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.sl-notification-toolbar strong {
  color: #0f172a;
  font-size: 17px;
  font-weight: 650;
  line-height: 24px;
}

.sl-notification-list > form { margin: 0; }

.sl-notification-item {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  background: #fff;
  color: #334155;
  font: inherit;
  text-align: left;
}

button.sl-notification-item { cursor: pointer; }

.sl-notification-item:hover,
.sl-notification-item:focus-visible { background: #f8fafc; }

.sl-notification-item:focus-visible {
  outline: 2px solid rgba(7, 193, 96, .28);
  outline-offset: -2px;
}

.sl-notification-item.is-unread { background: #f3fbf6; }
.sl-notification-item.is-unread:hover { background: #ebf8f0; }

.sl-notification-marker {
  width: 6px;
  height: 6px;
  margin-top: 7px;
  border-radius: 50%;
  background: transparent;
}

.sl-notification-item.is-unread .sl-notification-marker { background: #07a952; }

.sl-notification-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.sl-notification-copy strong {
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  overflow-wrap: anywhere;
}

.sl-notification-item.is-unread .sl-notification-copy strong { color: #0f172a; }

.sl-notification-copy > span {
  display: -webkit-box;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  line-height: 18px;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.sl-notification-copy time {
  color: #94a3b8;
  font-size: 11px;
  line-height: 17px;
}

.sl-notification-arrow {
  align-self: center;
  color: #c0c8d2;
  font-size: .75rem;
}

.sl-notification-read {
  display: grid;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
}

.sl-notification-read:hover,
.sl-notification-read:focus-visible {
  background: #e2f5e9;
  color: #078a47;
}

.sl-notification-pagination {
  display: grid;
  grid-template-columns: 32px auto 32px;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: #64748b;
  font-size: 11px;
}

.sl-notification-pagination a {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #dce3ea;
  border-radius: 8px;
  background: #fff;
  color: #475569;
}

.sl-notification-pagination a:hover { border-color: #9fdcb9; color: #078a47; }

@media (max-width: 575.98px) {
  .sl-notification-popover {
    top: 58px !important;
    right: 8px !important;
    left: 8px !important;
    width: auto;
    max-height: calc(100dvh - 66px);
  }
  .sl-notification-popover::before,
  .sl-notification-popover::after { display: none; }
  .sl-message-window {
    top: 0;
    right: 0;
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .sl-message-window .sl-communication-head,
  .sl-message-window .sl-communication-body { border-radius: 0; }
  .sl-communication-confirm { align-items: end; padding: 12px; }
  .sl-communication-confirm-card { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .sl-notification-popover,
  .sl-message-window { transition: none; }
}
