.printly-notifications {
  position: fixed;
  z-index: 2147483000;
  top: calc(18px + env(safe-area-inset-top, 0px));
  right: calc(18px + env(safe-area-inset-right, 0px));
  width: min(400px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  max-height: calc(100dvh - 48px - env(safe-area-inset-top, 0px));
  padding: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: none;
  scrollbar-width: thin;
}
.printly-notifications,
.printly-notifications * { box-sizing: border-box; }

.printly-toast {
  --toast-accent: #2563eb;
  --toast-accent-rgb: 37, 99, 235;
  --toast-soft: #eff6ff;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 13px 12px 13px 14px;
  overflow: hidden;
  border: 1px solid rgba(var(--toast-accent-rgb), .16);
  border-radius: 18px;
  background: rgba(255, 255, 255, .98);
  color: #172033;
  box-shadow: 0 20px 48px rgba(15, 23, 42, .14), 0 4px 12px rgba(15, 23, 42, .06);
  pointer-events: auto;
  text-align: left;
  font-family: inherit;
  animation: printly-toast-in .3s cubic-bezier(.16, 1, .3, 1);
}
.printly-toast::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--toast-accent);
}
.printly-toast::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: -45px;
  left: -34px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(var(--toast-accent-rgb), .055);
  pointer-events: none;
}
.printly-toast[data-type="success"] { --toast-accent: #15905b; --toast-accent-rgb: 21, 144, 91; --toast-soft: #ebfaf3; }
.printly-toast[data-type="error"] { --toast-accent: #dc3545; --toast-accent-rgb: 220, 53, 69; --toast-soft: #fff1f3; }
.printly-toast[data-type="warning"] { --toast-accent: #c57812; --toast-accent-rgb: 197, 120, 18; --toast-soft: #fff7e8; }

.printly-notifications .printly-toast-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(var(--toast-accent-rgb), .12);
  border-radius: 13px;
  background: var(--toast-soft);
  color: var(--toast-accent) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.printly-notifications svg {
  display: block;
  width: 20px;
  height: 20px;
  flex: none;
  color: inherit !important;
  stroke: currentColor !important;
  fill: none !important;
}
.printly-toast-copy { min-width: 0; }
.printly-notifications .printly-toast-copy strong {
  display: block;
  margin: 0 0 3px;
  color: var(--toast-accent) !important;
  font-size: 11px !important;
  font-weight: 650 !important;
  line-height: 1.35 !important;
  letter-spacing: .01em;
}
.printly-notifications .printly-toast-copy strong[hidden] { display: none !important; }
.printly-notifications .printly-toast-copy p {
  margin: 0;
  color: #26364f !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.55 !important;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.printly-notifications .printly-toast-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #8793a7 !important;
  box-shadow: none;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}
.printly-notifications .printly-toast-close svg { width: 16px; height: 16px; }
.printly-notifications .printly-toast-close:hover {
  color: #253858 !important;
  background: #f1f5f9;
  transform: scale(1.04);
}
.printly-notifications .printly-toast-close:active { transform: scale(.96); }
.printly-notifications .printly-toast-close:focus-visible {
  outline: 2px solid rgba(var(--toast-accent-rgb), .55);
  outline-offset: 2px;
  background: var(--toast-soft);
}

@keyframes printly-toast-in {
  from { opacity: 0; transform: translate3d(18px, -5px, 0) scale(.98); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@media (max-width: 768px) {
  .printly-notifications {
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: 50%;
    right: auto;
    width: min(400px, calc(100vw - 20px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    padding: 4px;
    transform: translateX(-50%);
  }
  .printly-toast {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 10px;
    min-height: 62px;
    padding: 11px 8px 11px 12px;
    border-radius: 16px;
  }
  .printly-notifications .printly-toast-icon { width: 38px; height: 38px; border-radius: 12px; }
  .printly-notifications .printly-toast-copy p { font-size: 12px !important; }
  .printly-notifications .printly-toast-close { width: 38px; height: 38px; min-width: 38px; min-height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .printly-toast { animation: none; }
  .printly-notifications .printly-toast-close { transition: none; }
}
@media print { .printly-notifications { display: none !important; } }
