/* ==========================================================================
   Sparkle — Modals, Overlays & Notifications
   ========================================================================== */

/* Command Palette Overlay */
#pal {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 18, 0.55);
  backdrop-filter: blur(4px);
  z-index: 90;
  display: flex;
  justify-content: center;
  padding: 12vh 16px 20px;
}
#pal[hidden] {
  display: none;
}

.pb {
  background: var(--pn);
  border: 1px solid var(--ln);
  border-radius: 20px;
  width: min(580px, 100%);
  max-height: 70vh;
  overflow-y: auto;
  align-self: flex-start;
  padding: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}
.pb input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--ln);
  background: none;
  color: inherit;
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  outline: 0;
}
.pb a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.1s;
}
.pb a small {
  margin-left: auto;
  font-size: 12px;
}
.pb a.on,
.pb a:hover {
  background: color-mix(in srgb, var(--c, var(--acc)) 14%, transparent);
  font-weight: 600;
}

/* Toast Notifications */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
  max-width: 90vw;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}
#toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Generic Modal Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 18, 0.6);
  backdrop-filter: blur(4px);
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay[hidden] {
  display: none;
}

.modal-dialog {
  background: var(--pn);
  border: 1px solid var(--ln);
  border-radius: 24px;
  max-width: 520px;
  width: 100%;
  padding: 28px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);
  animation: modalPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}
.modal-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--mut);
  margin-bottom: 22px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Mandatory Security Notices Styling */
.sec-caption {
  font-size: 12px;
  line-height: 1.5;
  color: var(--mut);
  margin-top: 8px;
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.sec-caption svg {
  flex: none;
  margin-top: 2px;
  color: #10b981;
}

.sec-banner {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.sec-banner svg {
  flex: none;
  margin-top: 2px;
  color: #10b981;
}
