#lentera-page-loader {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(241, 245, 249, .94);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

#lentera-page-loader,
#lentera-page-loader * { box-sizing: border-box; }

#lentera-page-loader.is-active {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lentera-loader-card {
  width: min(320px, 92vw);
  padding: 25px 24px 22px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(14, 165, 233, .18);
  border-top: 5px solid #18a6b8;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .2);
  text-align: center;
}

#lentera-page-loader .lentera-loader-logo {
  width: 76px !important;
  height: 76px !important;
  max-width: 76px !important;
  max-height: 76px !important;
  object-fit: contain;
  border-radius: 16px;
  animation: lentera-logo-hop .75s cubic-bezier(.28,.84,.42,1) infinite;
  filter: drop-shadow(0 12px 14px rgba(15, 23, 42, .17));
}

.lentera-loader-text {
  margin-top: 14px;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: .2px;
}

.lentera-loader-subtext {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
}

.lentera-loader-dots { display: inline-block; min-width: 22px; text-align: left; }
.lentera-loader-dots::after { content: ''; animation: lentera-dots 1s steps(4, end) infinite; }

#lentera-notify-host {
  position: fixed;
  z-index: 2147483200;
  top: 18px;
  right: 18px;
  width: min(410px, calc(100vw - 30px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.lentera-toast {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 28px;
  gap: 11px;
  align-items: start;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 16px 44px rgba(15, 23, 42, .18);
  opacity: 0;
  transform: translateY(-12px) scale(.98);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: auto;
  overflow: hidden;
}

.lentera-toast.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.lentera-toast.is-leaving { opacity: 0; transform: translateX(18px); }
.lentera-toast-success { border-left: 5px solid #16a34a; }
.lentera-toast-error { border-left: 5px solid #dc2626; }
.lentera-toast-warning { border-left: 5px solid #d97706; }
.lentera-toast-info { border-left: 5px solid #0284c7; }

.lentera-toast-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
}
.lentera-toast-success .lentera-toast-icon { background: #16a34a; }
.lentera-toast-error .lentera-toast-icon { background: #dc2626; }
.lentera-toast-warning .lentera-toast-icon { background: #d97706; }
.lentera-toast-info .lentera-toast-icon { background: #0284c7; }

.lentera-toast-content strong { display: block; margin-bottom: 3px; font-size: 14px; }
.lentera-toast-content div { font-size: 13px; line-height: 1.45; color: #475569; overflow-wrap: anywhere; }
.lentera-toast-close { border: 0; background: transparent; color: #64748b; font-size: 23px; line-height: 1; padding: 0; cursor: pointer; }

.lentera-file-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
}

input[type="file"].lentera-file-invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12) !important;
}

.lentera-button-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: lentera-spin .65s linear infinite;
}

@keyframes lentera-spin { to { transform: rotate(360deg); } }
@keyframes lentera-logo-hop {
  0%, 100% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-15px) scale(1.04); }
  58% { transform: translateY(0) scale(.98); }
  76% { transform: translateY(-5px) scale(1.01); }
}
@keyframes lentera-dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75%, 100% { content: '...'; }
}

@media (max-width: 600px) {
  #lentera-notify-host { top: 10px; right: 10px; width: calc(100vw - 20px); }
  .lentera-toast { grid-template-columns: 34px minmax(0, 1fr) 24px; padding: 12px 10px; }
  .lentera-loader-card { width: min(300px, 92vw); }
}

@media (prefers-reduced-motion: reduce) {
  #lentera-page-loader .lentera-loader-logo,
  .lentera-loader-dots::after,
  .lentera-button-spinner { animation-duration: 1.6s; }
  .lentera-toast { transition: none; }
}
