:root{
  --apu-dialog-accent:#5b5cf0;
  --apu-dialog-accent-2:#8b5cf6;
  --apu-dialog-danger:#ef4444;
  --apu-dialog-danger-2:#dc2626;
  --apu-dialog-success:#10b981;
  --apu-dialog-warning:#f59e0b;
  --apu-dialog-ink:#101828;
  --apu-dialog-muted:#667085;
  --apu-dialog-panel:rgba(255,255,255,.94);
  --apu-dialog-border:rgba(255,255,255,.68);
  --apu-dialog-shadow:0 32px 90px rgba(15,23,42,.30),0 10px 34px rgba(79,70,229,.16);
}
[data-theme="dark"],.dark,[data-color-scheme="dark"]{
  --apu-dialog-ink:#f8fafc;
  --apu-dialog-muted:#aab4c5;
  --apu-dialog-panel:rgba(16,24,40,.95);
  --apu-dialog-border:rgba(148,163,184,.20);
  --apu-dialog-shadow:0 36px 110px rgba(0,0,0,.58),0 12px 42px rgba(99,102,241,.22);
}
html.apu-dialog-open,html.apu-dialog-open body{overflow:hidden!important}
.apu-dialog{
  width:min(94vw,560px);
  max-width:560px;
  margin:auto;
  padding:0;
  border:0;
  background:transparent;
  color:var(--apu-dialog-ink);
  overflow:visible;
  z-index:2147483646;
}
.apu-dialog[open]{display:grid;place-items:center}
.apu-dialog::backdrop{
  background:
    radial-gradient(circle at 18% 20%,rgba(99,102,241,.23),transparent 32%),
    radial-gradient(circle at 82% 78%,rgba(168,85,247,.18),transparent 35%),
    rgba(5,10,24,.66);
  -webkit-backdrop-filter:blur(14px) saturate(125%);
  backdrop-filter:blur(14px) saturate(125%);
  animation:apuBackdropIn .22s ease-out both;
}
.apu-dialog__surface{
  position:relative;
  isolation:isolate;
  overflow:hidden;
  width:100%;
  border:1px solid transparent;
  border-radius:30px;
  background:
    linear-gradient(var(--apu-dialog-panel),var(--apu-dialog-panel)) padding-box,
    linear-gradient(135deg,rgba(255,255,255,.94),rgba(99,102,241,.65),rgba(168,85,247,.72),rgba(255,255,255,.50)) border-box;
  box-shadow:var(--apu-dialog-shadow);
  transform-origin:center;
  animation:apuDialogIn .34s cubic-bezier(.18,.89,.32,1.16) both;
}
.apu-dialog__surface::before,.apu-dialog__surface::after{
  content:"";
  position:absolute;
  border-radius:999px;
  filter:blur(1px);
  pointer-events:none;
  z-index:-1;
}
.apu-dialog__surface::before{
  width:220px;height:220px;right:-100px;top:-110px;
  background:radial-gradient(circle,rgba(99,102,241,.20),transparent 67%);
}
.apu-dialog__surface::after{
  width:190px;height:190px;left:-90px;bottom:-110px;
  background:radial-gradient(circle,rgba(168,85,247,.16),transparent 70%);
}
.apu-dialog__accent{
  height:6px;
  background:linear-gradient(90deg,var(--apu-dialog-accent),var(--apu-dialog-accent-2),#22d3ee);
  background-size:220% 100%;
  animation:apuGradient 5s linear infinite;
}
.apu-dialog[data-intent="danger"] .apu-dialog__accent{background:linear-gradient(90deg,#fb7185,var(--apu-dialog-danger),#f97316)}
.apu-dialog[data-intent="success"] .apu-dialog__accent{background:linear-gradient(90deg,#34d399,var(--apu-dialog-success),#22d3ee)}
.apu-dialog__body{padding:28px 28px 16px}
.apu-dialog__heading{display:flex;gap:17px;align-items:flex-start}
.apu-dialog__icon{
  flex:0 0 56px;width:56px;height:56px;
  display:grid;place-items:center;
  border-radius:19px;
  font-size:25px;
  background:linear-gradient(145deg,rgba(99,102,241,.18),rgba(139,92,246,.10));
  border:1px solid rgba(99,102,241,.24);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.55),0 12px 26px rgba(79,70,229,.15);
}
.apu-dialog[data-intent="danger"] .apu-dialog__icon{background:linear-gradient(145deg,rgba(239,68,68,.17),rgba(249,115,22,.10));border-color:rgba(239,68,68,.28);box-shadow:inset 0 1px 0 rgba(255,255,255,.48),0 12px 28px rgba(239,68,68,.16)}
.apu-dialog__copy{min-width:0;flex:1;padding-top:2px}
.apu-dialog__eyebrow{
  margin:0 0 6px;
  color:var(--apu-dialog-accent);
  font:800 11px/1.2 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  letter-spacing:.16em;text-transform:uppercase;
}
.apu-dialog[data-intent="danger"] .apu-dialog__eyebrow{color:var(--apu-dialog-danger)}
.apu-dialog__title{margin:0;font:800 clamp(20px,3vw,25px)/1.22 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;letter-spacing:-.025em;color:var(--apu-dialog-ink)}
.apu-dialog__message{margin:12px 0 0;color:var(--apu-dialog-muted);font:500 15px/1.7 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;white-space:pre-wrap;overflow-wrap:anywhere}
.apu-dialog__field{margin-top:20px}
.apu-dialog__field[hidden]{display:none!important}
.apu-dialog__input{
  box-sizing:border-box;width:100%;min-height:52px;padding:13px 15px;
  border:1.5px solid rgba(99,102,241,.25);border-radius:16px;
  background:rgba(248,250,252,.80);color:#101828;
  font:600 15px/1.4 Inter,ui-sans-serif,system-ui,sans-serif;
  outline:0;box-shadow:inset 0 1px 2px rgba(15,23,42,.04);
  transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease;
}
[data-theme="dark"] .apu-dialog__input,.dark .apu-dialog__input{background:rgba(15,23,42,.76);color:#f8fafc;border-color:rgba(148,163,184,.25)}
.apu-dialog__input:focus{border-color:var(--apu-dialog-accent);box-shadow:0 0 0 5px rgba(99,102,241,.13);transform:translateY(-1px)}
.apu-dialog__meta{display:flex;align-items:center;gap:9px;margin-top:18px;padding:11px 13px;border-radius:14px;background:rgba(148,163,184,.09);color:var(--apu-dialog-muted);font:600 12px/1.4 Inter,ui-sans-serif,system-ui,sans-serif}
.apu-dialog__meta-dot{width:8px;height:8px;border-radius:999px;background:var(--apu-dialog-accent);box-shadow:0 0 0 5px rgba(99,102,241,.10)}
.apu-dialog[data-intent="danger"] .apu-dialog__meta-dot{background:var(--apu-dialog-danger);box-shadow:0 0 0 5px rgba(239,68,68,.10)}
.apu-dialog__actions{display:flex;justify-content:flex-end;gap:11px;padding:18px 28px 27px}
.apu-dialog__button{
  appearance:none;min-height:48px;padding:0 20px;border-radius:15px;border:1px solid transparent;
  font:800 14px/1 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,filter .16s ease,background .16s ease;
  -webkit-tap-highlight-color:transparent;
}
.apu-dialog__button:hover{transform:translateY(-2px)}
.apu-dialog__button:active{transform:translateY(0) scale(.98)}
.apu-dialog__button:focus-visible{outline:3px solid rgba(99,102,241,.30);outline-offset:3px}
.apu-dialog__button--cancel{background:rgba(148,163,184,.10);border-color:rgba(148,163,184,.24);color:var(--apu-dialog-ink)}
.apu-dialog__button--cancel:hover{background:rgba(148,163,184,.17)}
.apu-dialog__button--confirm{color:#fff;background:linear-gradient(135deg,var(--apu-dialog-accent),var(--apu-dialog-accent-2));box-shadow:0 12px 24px rgba(79,70,229,.28)}
.apu-dialog__button--confirm:hover{filter:saturate(1.15) brightness(1.03);box-shadow:0 16px 30px rgba(79,70,229,.34)}
.apu-dialog[data-intent="danger"] .apu-dialog__button--confirm{background:linear-gradient(135deg,var(--apu-dialog-danger),var(--apu-dialog-danger-2));box-shadow:0 12px 25px rgba(239,68,68,.28)}
.apu-dialog[data-intent="danger"] .apu-dialog__button--confirm:hover{box-shadow:0 16px 32px rgba(239,68,68,.36)}
.apu-dialog__close{
  position:absolute;right:17px;top:18px;z-index:2;width:36px;height:36px;border-radius:12px;
  border:1px solid rgba(148,163,184,.22);background:rgba(255,255,255,.42);color:var(--apu-dialog-muted);
  display:grid;place-items:center;font-size:19px;line-height:1;cursor:pointer;transition:.16s ease;
}
[data-theme="dark"] .apu-dialog__close,.dark .apu-dialog__close{background:rgba(15,23,42,.48)}
.apu-dialog__close:hover{transform:rotate(5deg) scale(1.05);color:var(--apu-dialog-ink)}
.apu-notify-stack{position:fixed;z-index:2147483645;right:max(18px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));display:grid;gap:12px;width:min(92vw,390px);pointer-events:none}
.apu-notify{
  position:relative;overflow:hidden;display:grid;grid-template-columns:42px 1fr auto;align-items:center;gap:12px;
  padding:14px 14px 14px 13px;border-radius:18px;border:1px solid rgba(255,255,255,.62);
  background:var(--apu-dialog-panel);color:var(--apu-dialog-ink);box-shadow:0 20px 55px rgba(15,23,42,.24);
  -webkit-backdrop-filter:blur(16px) saturate(130%);backdrop-filter:blur(16px) saturate(130%);
  pointer-events:auto;animation:apuToastIn .28s cubic-bezier(.18,.89,.32,1.18) both;
}
.apu-notify::after{content:"";position:absolute;left:0;bottom:0;height:3px;width:100%;transform-origin:left;background:linear-gradient(90deg,var(--apu-dialog-accent),var(--apu-dialog-accent-2));animation:apuToastTimer var(--apu-toast-duration,3200ms) linear both}
.apu-notify[data-tone="danger"]::after{background:linear-gradient(90deg,#fb7185,var(--apu-dialog-danger))}
.apu-notify__icon{width:42px;height:42px;border-radius:14px;display:grid;place-items:center;background:rgba(99,102,241,.13);font-size:19px}
.apu-notify__text{font:700 13px/1.45 Inter,ui-sans-serif,system-ui,sans-serif;overflow-wrap:anywhere}
.apu-notify__close{border:0;background:transparent;color:var(--apu-dialog-muted);font-size:18px;cursor:pointer;padding:6px}
.apu-notify.apu-notify--out{animation:apuToastOut .22s ease-in both}
@keyframes apuBackdropIn{from{opacity:0}to{opacity:1}}
@keyframes apuDialogIn{from{opacity:0;transform:translateY(24px) scale(.94) rotateX(4deg)}to{opacity:1;transform:translateY(0) scale(1) rotateX(0)}}
@keyframes apuGradient{to{background-position:220% 0}}
@keyframes apuToastIn{from{opacity:0;transform:translateX(28px) scale(.96)}to{opacity:1;transform:none}}
@keyframes apuToastOut{to{opacity:0;transform:translateX(22px) scale(.97)}}
@keyframes apuToastTimer{from{transform:scaleX(1)}to{transform:scaleX(0)}}
@media(max-width:560px){
  .apu-dialog{width:min(94vw,520px)}
  .apu-dialog__surface{border-radius:24px}
  .apu-dialog__body{padding:24px 20px 13px}
  .apu-dialog__heading{gap:13px}
  .apu-dialog__icon{flex-basis:48px;width:48px;height:48px;border-radius:16px;font-size:22px}
  .apu-dialog__actions{padding:16px 20px 22px;display:grid;grid-template-columns:1fr 1fr}
  .apu-dialog__button{width:100%;padding:0 14px}
  .apu-dialog[data-mode="alert"] .apu-dialog__actions{grid-template-columns:1fr}
  .apu-dialog__close{right:12px;top:13px}
}
@media(prefers-reduced-motion:reduce){
  .apu-dialog::backdrop,.apu-dialog__surface,.apu-dialog__accent,.apu-notify,.apu-notify::after{animation:none!important}
  .apu-dialog__button,.apu-dialog__close,.apu-dialog__input{transition:none!important}
}
